鍵盤控制碼

  1. 可用於MainFormKeyDown事件 :
  2. 例如:按"朝左"方向鍵(Keys.Left為37),圖片左移10個單位:

    If  e.Keycode = 37  Then

    picturebox1.Left = picturebox1.Left - 10

    End If

VB.Net的鍵盤碼 代號 相對按鍵
Keys.LButton 1 Left mouse button
Keys.RButton 2 Right mouse button
Keys.Cancel 3 CANCEL key
Keys.MButton 4 Middle mouse button
Keys.Back 8 BACKSPACE key
Keys.Tab 9 TAB key
Keys.Clear 12 CLEAR key
Keys.Return 13 ENTER key
Keys.Shift 16 SHIFT key
Keys.Control 17 CTRL key
Keys.Menu 18 MENU key
Keys.Pause 19 PAUSE key
Keys.Capital 20 CAPS LOCK key
Keys.Escape 27 ESC key
Keys.Space 32 SPACEBAR key
Keys.PageUp 33 PAGE UP key
Keys.PageDown 34 PAGE DOWN key
Keys.End 35 END key
Keys.Home 36 HOME key
Keys.Left 37 LEFT ARROW key
Keys.Up 38 UP ARROW key
Keys.Right 39 RIGHT ARROW key
Keys.Down 40 DOWN ARROW key
Keys.Select 41 SELECT key
Keys.Print 42 PRINT SCREEN key
Keys.Execute 43 EXECUTE key
Keys.Snapshot 44 SNAPSHOT key
Keys.Insert 45 INS key
Keys.Delete 46 DEL key
Keys.Help 47 HELP key
Keys.0 48 0 key
Keys.1 49 1 key
Keys.2 50 2 key
Keys.3 51 3 key
Keys.4 52 4 key
Keys.5 53 5 key
Keys.6 54 6 key
Keys.7 55 7 key
Keys.8 56 8 key
Keys.9 57 9 key
Keys.A 65 A key
Keys.B 66 B key
Keys.C 67 C key
Keys.D 68 D key
Keys.E 69 E key
Keys.F 70 F key
Keys.G 71 G key
Keys.H 72 H key
Keys.I 73 I key
Keys.J 74 J key
Keys.K 75 K key
Keys.L 76 L key
Keys.M 77 M key
Keys.N 78 N key
Keys.O 79 O key
Keys.P 80 P key
Keys.Q 81 Q key
Keys.R 82 R key
Keys.S 83 S key
Keys.T 84 T key
Keys.U 85 U key
Keys.V 86 V key
Keys.W 87 W key
Keys.X 88 X key
Keys.Y 89 Y key
Keys.Z 90 Z key
Keys.Numpad0 96 0 key
Keys.Numpad1 97 1 key
Keys.Numpad2 98 2 key
Keys.Numpad3 99 3 key
Keys.Numpad4 100 4 key
Keys.Numpad5 101 5 key
Keys.Numpad6 102 6 key
Keys.Numpad7 103 7 key
Keys.Numpad8 104 8 key
Keys.Numpad9 105 9 key
Keys.Multiply 106 MULTIPLICATION SIGN (*) key
Keys.Add 107 PLUS SIGN (+) key
Keys.Separator 108 ENTER (keypad) key
Keys.Subtract 109 MINUS SIGN (-) key
Keys.Decimal 110 DECIMAL POINT(.) key
Keys.Divide 111 DIVISION SIGN (/) key
Keys.F1 112 F1 key
Keys.F2 113 F2 key
Keys.F3 114 F3 key
Keys.F4 115 F4 key
Keys.F5 116 F5 key
Keys.F6 117 F6 key
Keys.F7 118 F7 key
Keys.F8 119 F8 key
Keys.F9 120 F9 key
Keys.F10 121 F10 key
Keys.F11 122 F11 key
Keys.F12 123 F12 key
Keys.F13 124 F13 key
Keys.F14 125 F14 key
Keys.F15 126 F15 key
Keys.F16 127 F16 key
Keys.Numlock 144 NUM LOCK key