form1.frm
来自「150个经典VB API应用实例.全部是运用API写的小程序」· FRM 代码 · 共 51 行
FRM
51 行
VERSION 5.00
Begin VB.Form Form1
BackColor = &H80000000&
BorderStyle = 1 'Fixed Single
ClientHeight = 1815
ClientLeft = 45
ClientTop = 330
ClientWidth = 2565
FillStyle = 0 'Solid
KeyPreview = -1 'True
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 121
ScaleMode = 3 'Pixel
ScaleWidth = 171
StartUpPosition = 3 '窗口缺省
Begin VB.CheckBox Check1
Appearance = 0 'Flat
BackColor = &H80000000&
Caption = "悬挂式窗口(是否顶端)"
ForeColor = &H80000008&
Height = 375
Left = 180
MaskColor = &H00FFFFFF&
TabIndex = 0
Top = 660
Width = 2175
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Check1_Click()
Dim res As Long
If Check1.Value = 1 Then
res = SetWindowPos(Me.hwnd, HWND_TOPMOST, _
0, 0, 0, 0, Flags)
Else
res = SetWindowPos(Me.hwnd, HWND_NOTOPMOST, _
0, 0, 0, 0, Flags)
End If
End Sub
Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = 27 Then Unload Me
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?