回复 楼主 easonzgf
使用API
Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Sub Form_Load()
Me.Show
Do
If GetAsyncKeyState(vbKeyLButton) And GetAsyncKeyState(vbKeyRButton) Then Form1.Caption = "左右"
If GetAsyncKeyState(vbKeyLButton) Then Form1.Caption = "左"
If GetAsyncKeyState(vbKeyRButton) Then Form1.Caption = "右"
DoEvents
Loop
End Sub