VB 热键

来源:百度知道 编辑:UC知道 时间:2024/05/31 08:49:29
只要程序在启动情况下,无论窗口什么状态。只要按F12就可以执行Command1的程序。怎么弄?什么API或者注册表?
哪个API怎么修改哪个注册表

用API注册热键
但是VB这样做会使程序不稳定
==============================
天~API注册热键~和注册表没关系~
不建议VB6使用热键

Private Sub Form_Load()
KeyPreview = True
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF12 Then Command1_Click

End Sub
希望可以帮助你的