📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "实现多边形窗体"
ClientHeight = 3030
ClientLeft = 60
ClientTop = 345
ClientWidth = 4290
LinkTopic = "Form1"
ScaleHeight = 3030
ScaleWidth = 4290
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "实现多边形窗体"
Height = 855
Left = 1080
TabIndex = 0
Top = 840
Width = 2055
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Type POINTAPI
X As Long
Y As Long
End Type
Private Declare Function SetWindowRgn Lib "user32" (ByVal hwnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Private Declare Function CreatePolygonRgn Lib "gdi32" (lpPoint As POINTAPI, ByVal nCount As Long, ByVal nPolyFillMode As Long) As Long
Private Sub Command1_Click()
Dim ShapeV(8) As POINTAPI
On Error Resume Next
ShapeV(0).X = 111: ShapeV(0).Y = 54
ShapeV(1).X = 91: ShapeV(1).Y = 117
ShapeV(2).X = 134: ShapeV(2).Y = 202
ShapeV(3).X = 216: ShapeV(3).Y = 193
ShapeV(4).X = 251: ShapeV(4).Y = 111
ShapeV(5).X = 219: ShapeV(5).Y = 41
ShapeV(6).X = 115: ShapeV(6).Y = 52
ShapeV(7).X = 111: ShapeV(7).Y = 54
Me.Width = 6000
Me.Height = 6000
er = SetWindowRgn(Me.hwnd, CreatePolygonRgn(ShapeV(0), 8, 1), True)
Me.Show
End Sub
Private Sub Form_DblClick()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -