📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
BackColor = &H00C0C0C0&
Caption = "动态卷帘式窗体演示"
ClientHeight = 7590
ClientLeft = 8325
ClientTop = 405
ClientWidth = 3570
LinkTopic = "Form1"
ScaleHeight = 7590
ScaleWidth = 3570
Begin VB.CommandButton Command2
BackColor = &H00FFC0C0&
Caption = "退出"
Height = 360
Left = 1785
Style = 1 'Graphical
TabIndex = 2
Top = 0
Width = 1785
End
Begin VB.CommandButton Command1
BackColor = &H00FFC0C0&
Caption = "窗体伸缩"
Height = 360
Left = 0
Style = 1 'Graphical
TabIndex = 1
Top = 0
Width = 1785
End
Begin VB.Timer Timer1
Interval = 300
Left = 2000
Top = 450
End
Begin VB.Label Label1
BackColor = &H00C0C0C0&
Caption = "注意: 请将鼠标移出窗体,您会看到意想不到的效果!"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0000FFFF&
Height = 6615
Left = 165
TabIndex = 0
Top = 525
Width = 3225
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Type POINTAPI
X As Long
Y As Long
End Type
Private Sub Timer1_Timer() '动态延伸窗体
Dim n As POINTAPI
GetCursorPos n
If n.X > 300 Then
For I = 0 To 8000
Me.Height = Me.Height + 2
Next I
Else
If Me.Height > 450 Then
For I = 0 To 8000
Me.Height = Me.Height - 2
Next I
End If
End If
End Sub
Private Sub Command1_Click() '收缩窗体
If Me.Height > 450 Then
For I = 0 To 8000
Me.Height = Me.Height - 2
Next I
End If
End Sub
Private Sub Command2_Click()
End
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -