[这个贴子最后由Yuki在 2003/11/02 02:36am 第 3 次编辑]
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Label4.Caption = KeyCode
Label2.Caption = ""
Label5.Caption = ""
Cls
Select Case KeyCode
Case 27
Label5.Caption = "Esc"
Case 37
Label5.Caption = "←"
Case 38
Label5.Caption = "↑"
Case 39
Label5.Caption = "→"
Case 40
Label5.Caption = "↓"
Case 112
Label5.Caption = "F1"
Case 113
Label5.Caption = "F2"
Case 114
Label5.Caption = "F3"
Case 115
Label5.Caption = "F4"
Case 116
Label5.Caption = "F5"
Case 117
Label5.Caption = "F6"
Case 118
Label5.Caption = "F7"
Case 119
Label5.Caption = "F8"
Case 120
Label5.Caption = "F9"
Case 121
Label5.Caption = "F10"
Case 122
Label5.Caption = "F11"
Case 123
Label5.Caption = "F12"
Case 13
Label5.Caption = "Enter"
Case 8
Label5.Caption = "Back"
Case 9
Label5.Caption = "Tab"
Case 16
Label5.Caption = "Shift"
Case 17
Label5.Caption = "Ctrl"
Case 20
Label5.Caption = "Caps Lock"
Case 91
Label5.Caption = "Windows"
Case 18
Label5.Caption = "Alt"
Case 32
Label5.Caption = "空格键"
Case 93
Label5.Caption = "Win→"
Case 45
Label5.Caption = "Insert"
Case 145
Label5.Caption = "Scroll Lock"
Case 19
Label5.Caption = "Break"
Case 36
Label5.Caption = "Home"
Case 35
Label5.Caption = "End"
Case 34
Label5.Caption = "Page Down"
Case 33
Label5.Caption = "Page Up"
Case 46
Label5.Caption = "Del"
Case 144
Label5.Caption = "Num Lock"
Case 12
Label5.Caption = "中心键"
End Select
End Sub
Private Sub Form_KeyPress(KeyAscii As Integer)
Cls
Print KeyAscii
If kryascii = 13 Then
Label2.Caption = "Inter"
Else
Label2.Caption = Chr$(KeyAscii)
End If
End Sub |