1个回答
展开全部
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Dim a
Private Sub Form_Load()
Timer1.Interval = 1
Timer1.Enabled = False
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
a = Asc(Text1.Text)
Timer1.Enabled = True
End If
End Sub
Private Sub Timer1_Timer()
If GetAsyncKeyState(a) Then MsgBox "热键调用成功!!", vbOKOnly
End Sub
这是设置热键的以个例子,你可以改一下呀
Dim a
Private Sub Form_Load()
Timer1.Interval = 1
Timer1.Enabled = False
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
a = Asc(Text1.Text)
Timer1.Enabled = True
End If
End Sub
Private Sub Timer1_Timer()
If GetAsyncKeyState(a) Then MsgBox "热键调用成功!!", vbOKOnly
End Sub
这是设置热键的以个例子,你可以改一下呀
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询