Option Explicit Private Sub Form_KeyDown(KeyCode As Integer,Shift As Integer) If KeyCode = Asc("A") Then '按下A键 Call sub_xxxx1 ElseIf KeyCode = Asc("B") Then '按下B键 Call sub_xxxx2 End If End Sub Private Sub Form_Load() Me.KeyPreview = True End Sub
Option Explicit Private Sub Form_KeyDown(KeyCode As Integer,Shift As Integer) If KeyCode = Asc("A") Then '按下A键 Call sub_xxxx1 ElseIf KeyCode = Asc("B") Then '按下B键 Call sub_xxxx2 End If End Sub Private Sub Form_Load() Me.KeyPreview = True End Sub