📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "控件焦点"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command3
Caption = "按钮3"
Height = 495
Left = 2880
TabIndex = 4
Top = 1920
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "按钮2"
Height = 495
Left = 1560
TabIndex = 3
Top = 1920
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "按钮1"
Height = 495
Left = 240
TabIndex = 1
Top = 1920
Width = 1215
End
Begin VB.TextBox Text1
Height = 495
Left = 600
TabIndex = 0
Text = "鼠标选择后,单击按钮"
Top = 360
Width = 3015
End
Begin VB.Label Label1
Caption = "Label1"
Height = 495
Left = 600
TabIndex = 2
Top = 960
Width = 3015
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Text1_LostFocus()
If Screen.ActiveControl Is Me.Command1 Then
Label1.Caption = "按到按钮1"
Exit Sub
End If
If Screen.ActiveControl Is Me.Command2 Then
Label1.Caption = "按到按钮2"
Exit Sub
End If
If Screen.ActiveControl Is Me.Command3 Then
Label1.Caption = "按到按钮3"
Exit Sub
End If
Label1.Caption = "进行LostFoucs的处理"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -