用一个boolean类型的变量flag来控制,避免连击导致的错误,flag初始值为truePrivate Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)If flag = True And KeyCode = vbKeyLeft Thenflag = False'call a1End IfEnd SubPrivate Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)If flag = False And KeyCode = vbKeyLeft Thenflag = True'call a2...
添加一个Timer,取名为TimerHotKeyPrivate Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As IntegerPrivate Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds A...
Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)Print "鼠标按下"End SubPrivate Sub Command1_MouseUp(Button As Integer, Shift As Int...
窗体上按F2试试看Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF2 Then
Print "按下f2"'按下执行一个操作,具体什么自己换成对应的
End IfEnd SubPrivat...