Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer Private Sub timer1_timer() '无论你点哪 都提示 不光是窗体上 x = GetAsyncKeyState(1) '获得左键状态 If x = -32767 Then MsgBox "单击了左键" x = GetAsyncKeyState(2) '获得左键状态 If x = -32767 Then MsgBox "单击了右键"End Sub
Private Sub timer1_timer()
'无论你点哪 都提示 不光是窗体上
x = GetAsyncKeyState(1) '获得左键状态
If x = -32767 Then MsgBox "单击了左键"
x = GetAsyncKeyState(2) '获得左键状态
If x = -32767 Then MsgBox "单击了右键"End Sub