快捷键呼出窗体的方法
我想在form1上设置了一个按钮,点击下窗体隐藏(hide实现)
然后我想按下键盘上的HOME(或者F12等其他键)键再次呼出窗体,请问怎么实现
我用了keypress,可是没成功
期待指点
Option Explicit
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Private Sub Form_Load() Timer1.Interval = 100 Me.Hide End Sub
Private Sub Timer1_Timer() If MyHotKey(vbKeyF2) Then Me.Show End Sub
Private Function MyHotKey(vKeyCode) As Boolean MyHotKey = (GetAsyncKeyState(vbKeyHome) < 0) End Function