|
1. 按ESC键可以关闭窗体
Private Sub UserForm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = 27 Then
Unload Me
End If
End Sub
2. 按CTRL+Z 窗体的高度在原来的高度上+10(窗体的高度越来越高)
Private Sub UserForm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If Shift = 2 And KeyCode = 90 Then
Me.Height = Me.Height + 10
End If
End Sub
3. 按CTRL+X 窗体的高度在原来的基础上-10
Private Sub UserForm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If Shift = 2 And KeyCode = 88 Then
Me.Height = Me.Height - 10
End If
End Sub
4. 按ctrl+shift键的同时左键单击窗体,可以把窗体关闭
Private Sub UserForm_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
If Button = 1 And Shift = 3 Then
Unload Me
End If
End Sub
|
评分
-
查看全部评分
|