1个回答
2015-11-26
展开全部
给你说个简单好用的办法把
'1添加一个Timer时间控件
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
'申明api
Private Function MyHotKey(vKeyCode) As Boolean
MyHotKey = ((GetAsyncKeyState(vKeyCode) < 0))
End Function
Private Sub Form_Load()
Timer1.Interval = 100 '定时检测
Me.Visible = False
End Sub
Private Sub Timer1_Timer()
If MyHotKey(vbKeyO) Then Me.Visible = True
'还可以换成调用其他函数
End Sub
'1添加一个Timer时间控件
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
'申明api
Private Function MyHotKey(vKeyCode) As Boolean
MyHotKey = ((GetAsyncKeyState(vKeyCode) < 0))
End Function
Private Sub Form_Load()
Timer1.Interval = 100 '定时检测
Me.Visible = False
End Sub
Private Sub Timer1_Timer()
If MyHotKey(vbKeyO) Then Me.Visible = True
'还可以换成调用其他函数
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询