想问大家一个问题,就是按钮控件数组怎么设置快捷键
你可以看看以下这段代码,应该能满足你的要求
Option Explicit
Private Sub Command1_Click(Index As Integer)
If Index = 0 Then
MsgBox "按钮1"
ElseIf Index = 1 Then
MsgBox "按钮2"
End If
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = Asc("A") Then '按下A键
Command1(0)。 Value = True
ElseIf K...全部
你可以看看以下这段代码,应该能满足你的要求
Option Explicit
Private Sub Command1_Click(Index As Integer)
If Index = 0 Then
MsgBox "按钮1"
ElseIf Index = 1 Then
MsgBox "按钮2"
End If
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = Asc("A") Then '按下A键
Command1(0)。
Value = True
ElseIf KeyCode = Asc("B") Then '按下B键
Command1(1)。Value = True
End If
End Sub
Private Sub Form_Load()
Me。
KeyPreview = True
End Sub
。收起