用keydown事件截获~~~~如果用form截获,请把form的KeyPreview 设为true Dim HotH As BooleanPrivate Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) If HotH = True And KeyCode = 86 Then MsgBox ("您按下了快捷键") End If If Shift = 2 And KeyCode = 72 Then HotH = True: L.Caption = "11111"End Sub
Dim HotH As BooleanPrivate Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If HotH = True And KeyCode = 86 Then
MsgBox ("您按下了快捷键")
End If
If Shift = 2 And KeyCode = 72 Then HotH = True: L.Caption = "11111"End Sub
不好意思,把那個l.caption=“lll” 去掉,那是我調試用的~~~~