⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 菱形窗口.frm

📁 个人VB学习源码精选,自己学习时的一些编程小程序,希望对大家有帮助
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3195
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3195
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function CreatePolygonRgn Lib "gdi32" (lpPoint As PointAPI, ByVal nCount As Long, ByVal nPolyFillMode As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Private Type PointAPI
    x As Long
    y As Long
End Type

Private Sub Form_Load()
    Dim Ap(4) As PointAPI
    Dim Hx As Long
    Dim Hy As Long
    Dim reRgn As Long
    
    Hy = Me.Height \ (2 * Screen.TwipsPerPixelY)
    Hx = Me.Width \ (2 * Screen.TwipsPerPixelX)
    Ap(0).x = 0: Ap(0).y = Hy
    Ap(1).x = Hx: Ap(1).y = 0
    Ap(2).x = Me.Width \ Screen.TwipsPerPixelX: Ap(2).y = Hy
    Ap(3).x = Hx: Ap(3).y = Me.Height \ Screen.TwipsPerPixelY
    Ap(4) = Ap(0)
    reRgn = CreatePolygonRgn(Ap(0), 5, 1)
    SetWindowRgn Me.hWnd, reRgn, True
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -