先建立个函数
响应热键事件
Public Sub ShowQuick(keycodee As Integer)
If keycodee = vbKeyF1 Then Call 事件1
If keycodee = vbKeyF3
Then Call 事件2
If keycodee = vbKeyF6
Then Call 事件3
If keycodee = 115 Then Call 事件4
If keycodee = vbKeyF8 Then Call 事件5
If keycodee = vbKeyF9 Then Call 事件6
If keycodee = 122 Then Call 事件7
If keycodee = vbKeyF12 Then Call 事件8
End Sub
再在窗体 KeyDown 事件中调用就可以啊
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Dim CtrlDown
Call ShowQuick(KeyCode)
CtrlDown = (Shift And vbCtrlMask) > 0
If KeyCode = vbKeyReturn Then
If CtrlDown Then
Call cmdOK_Click
End If
End If
这是我以前系统里面的 例子