Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer Public Function MyHotKey(vKeyCode) As Boolean MyHotKey = (GetAsyncKeyState(vKeyCode) < 0) End Function 在Form1窗体上放一 Timer控件添加如下代码: timer1.interval=100 Private Sub Timer1_Timer() DoEvents If MyHotKey(vbKeyF10) Then 'F10 form1.show End If end sub 绝对好用,可在WINDOWS环境下激活。
Public Function MyHotKey(vKeyCode) As Boolean
MyHotKey = (GetAsyncKeyState(vKeyCode) < 0)
End Function
在Form1窗体上放一 Timer控件添加如下代码:
timer1.interval=100
Private Sub Timer1_Timer()
DoEvents
If MyHotKey(vbKeyF10) Then 'F10
form1.show
End If
end sub
绝对好用,可在WINDOWS环境下激活。