2个回答
2014-01-10
展开全部
'定义了一个F1触发Command1_Click,系统级的热键,自己修改一下
Option Explicit
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Private Sub Command1_Click()
Debug.Print Timer
End Sub
Private Sub Form_Load()
Timer1.Interval = 100
End Sub
Private Sub Timer1_Timer()
If GetAsyncKeyState(vbKeyF1) Then
Do Until (GetAsyncKeyState(vbKeyF1) >= 0) '防止长按键
DoEvents
Loop
Command1_Click
End If
End Sub
Option Explicit
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Private Sub Command1_Click()
Debug.Print Timer
End Sub
Private Sub Form_Load()
Timer1.Interval = 100
End Sub
Private Sub Timer1_Timer()
If GetAsyncKeyState(vbKeyF1) Then
Do Until (GetAsyncKeyState(vbKeyF1) >= 0) '防止长按键
DoEvents
Loop
Command1_Click
End If
End Sub
2014-01-10
展开全部
系统热键。百度VB注册系统热键。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询