VB快捷键调出窗口的代码
比如我切换输入法就能调出窗口2,这样怎么弄?注意:是在任何程序下调出,不是在窗口1里切换输入法调出!...
比如我切换输入法就能调出窗口2,这样怎么弄?注意:是在任何程序下调出,不是在窗口1里切换输入法调出!
展开
1个回答
展开全部
这里就以Form1为例,然后添加一个Timer1,实现代码如下:
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
╱*默认启动时窗体隐藏*╱
Private Sub Form_Load()
Timer1.Interval = 50
Timer1.Enabled = True
Me.Hide
End Sub
╱*监控键盘按键是否为【Ctrl+Space】*╱
Private Sub Timer1_Timer()
Dim Rtn As Integer
If GetAsyncKeyState(vbKeyControl) And GetAsyncKeyState(vbKeySpace) Then Me.Show
End Sub
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
╱*默认启动时窗体隐藏*╱
Private Sub Form_Load()
Timer1.Interval = 50
Timer1.Enabled = True
Me.Hide
End Sub
╱*监控键盘按键是否为【Ctrl+Space】*╱
Private Sub Timer1_Timer()
Dim Rtn As Integer
If GetAsyncKeyState(vbKeyControl) And GetAsyncKeyState(vbKeySpace) Then Me.Show
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询