VB Keycode 常数

合集下载

vb 每个键的KeyAscii值

vb 每个键的KeyAscii值

VB keypress事件中键盘上每个键的KeyAscii值键码常数值描述vbKeyLButton 1 鼠标左键vbKeyRButton 2 鼠标右键vbKeyCancel 3 CANCEL 键vbKeyMButton 4 鼠标中键vbKeyBack 8 BACKSPACE 键vbKeyTab 9 TAB 键vbKeyClear 12 CLEAR 键vbKeyReturn 13 ENTER 键vbKeyShift 16 SHIFT 键vbKeyControl 17 CTRL 键vbKeyMenu 18 菜单键vbKeyPause 19 PAUSE 键vbKeyCapital 20 CAPS LOCK 键vbKeyEscape 27 ESC 键vbKeySpace 32 SPACEBAR 空格键vbKeyPageUp 33 PAGEUP 键vbKeyPageDown 34 PAGEDOWN 键vbKeyEnd 35 END 键vbKeyHome 36 HOME 键vbKeyLeft 37LEFT ARROW 键vbKeyUp 38 UP ARROW 键vbKeyRight 39 RIGHT ARROW 键vbKeyDown 40 DOWN ARROW 键vbKeySelect 41 SELECT 键vbKeyPrint 42 PRINT SCREEN 键vbKeyExecute 43 EXECUTE 键vbKeySnapshot 44 SNAP SHOT 键vbKeyInser 45 INS 键vbKeyDelete 46 DEL 键vbKeyHelp 47 HELP 键vbKeyNumlock 144 NUM LOCK 键A 键到 Z 键与其 ASCII 码的相应值'A' 到 'Z' 是一致的常数值描述vbKeyA 65 A 键vbKeyB 66 B 键vbKeyC 67 C 键vbKeyD 68 D 键vbKeyE 69 E 键vbKeyF 70 F 键vbKeyG 71 G 键vbKeyH 72 H 键vbKeyI 73 I 键vbKeyJ 74 J 键vbKeyK 75 K 键vbKeyL 76 L 键vbKeyM 77 M 键vbKeyN 78 N 键vbKeyO 79 O 键vbKeyP 80 P 键vbKeyQ 81 Q 键vbKeyR 82 R 键vbKeyS 83 S 键vbKeyT 84 T 键vbKeyU 85 U 键vbKeyV 86 V 键vbKeyW 87 W 键vbKeyX 88 X 键vbKeyY 89 Y 键vbKeyZ 90 Z 键0 键到 9 键与其 ASCII 码的相应值 '0' 到 '9' 是一致的常数值描述vbKey0 48 0 键vbKey1 49 1 键vbKey2 50 2 键vbKey3 51 3 键vbKey4 52 4 键vbKey5 53 5 键vbKey6 54 6 键vbKey7 55 7 键vbKey8 56 8 键vbKey9 57 9 键数字小键盘上的键常数值描述vbKeyNumpad0 96 0 键vbKeyNumpad1 97 1 键vbKeyNumpad2 98 2 键vbKeyNumpad3 99 3 键vbKeyNumpad4 100 4 键vbKeyNumpad5 101 5 键vbKeyNumpad6 102 6 键vbKeyNumpad7 103 7 键vbKeyNumpad8 104 8 键vbKeyNumpad9 105 9 键vbKeyMultiply 106 乘号 (*) 键vbKeyAdd 107 加号 (+) 键vbKeySeparator 108 ENTER 键(在数字小键盘上)vbKeySubtract 109 减号 (-) 键vbKeyDecimal 110 小数点 (.) 键vbKeyDivide 111 除号 (/) 键功能键常数值描述vbKeyF1 112 F1 键vbKeyF2 113 F2 键vbKeyF3 114 F3 键vbKeyF4 115 F4 键vbKeyF5 116 F5 键vbKeyF6 117 F6 键vbKeyF7 118 F7 键vbKeyF8 119 F8 键vbKeyF9 120 F9 键vbKeyF10 121 F10 键vbKeyF11 122 F11 键vbKeyF12 123 F12 键vbKeyF13 124 F13 键vbKeyF14 125 F14 键vbKeyF15 126 F15 键vbKeyF16 127 F16 键这三个键子比较特殊,KeyAscii和KeyCode不同。

键盘对应数字-keycode值大全

键盘对应数字-keycode值大全

键盘对应数字-keycode值大event.keycode值大全 1 keycode 8 = BackSpace BackSpace 2 keycode 9 = Tab Tab 3 keycode 12 = Clear 4 keycode 13 = Enter 5 keycode 16 = Shift_L 6 keycode 17 = Control_L 7 keycode 18 = Alt_L 8 keycode 19 = Pause 9 keycode 20 = Caps_Lock 10 keyevent.keycode值大全1 keycode 8 = BackSpace BackSpace2 keycode 9 = Tab Tab3 keycode 12 = Clear4 keycode 13 = Enter5 keycode 16 = Shift_L6 keycode 17 = Control_L7 keycode 18 = Alt_L8 keycode 19 = Pause9 keycode 20 = Caps_Lock10 keycode 27 = Escape Escape11 keycode 32 = space space12 keycode 33 = Prior13 keycode 34 = Next14 keycode 35 = End15 keycode 36 = Home17 keycode 38 = Up18 keycode 39 = Right19 keycode 40 = Down20 keycode 41 = Select21 keycode 42 = Print22 keycode 43 = Execute23 keycode 45 = Insert24 keycode 46 = Delete25 keycode 47 = Help26 keycode 48 = 0 equal braceright27 keycode 49 = 1 exclam onesuperior28 keycode 50 = 2 quotedbl twosuperior29 keycode 51 = 3 section threesuperior30 keycode 52 = 4 dollar31 keycode 53 = 5 percent32 keycode 54 = 6 ampersand33 keycode 55 = 7 slash braceleft34 keycode 56 = 8 parenleft bracketleft35 keycode 57 = 9 parenright bracketright36 keycode 65 = a A37 keycode 66 = b B39 keycode 68 = d D40 keycode 69 = e E EuroSign41 keycode 70 = f F4243 keycode 71 = g G44 keycode 72 = h H45 keycode 73 = i I46 keycode 74 = j J47 keycode 75 = k K48 keycode 76 = l L49 keycode 77 = m M mu50 keycode 78 = n N51 keycode 79 = o O52 keycode 80 = p P53 keycode 81 = q Q at54 keycode 82 = r R55 keycode 83 = s S56 keycode 84 = t T57 keycode 85 = u U58 keycode 86 = v V59 keycode 87 = w W61 keycode 89 = y Y62 keycode 90 = z Z63 keycode 96 = KP_0 KP_064 keycode 97 = KP_1 KP_165 keycode 98 = KP_2 KP_266 keycode 99 = KP_3 KP_367 keycode 100 = KP_4 KP_468 keycode 101 = KP_5 KP_569 keycode 102 = KP_6 KP_670 keycode 103 = KP_7 KP_771 keycode 104 = KP_8 KP_872 keycode 105 = KP_9 KP_973 keycode 106 = KP_Multiply KP_Multiply74 keycode 107 = KP_Add KP_Add7576 keycode 108 = KP_Separator KP_Separator77 keycode 109 = KP_Subtract KP_Subtract78 keycode 110 = KP_Decimal KP_Decimal79 keycode 111 = KP_Divide KP_Divide80 keycode 112 = F181 keycode 113 = F283 keycode 115 = F4848586 keycode 116 = F587 keycode 117 = F688 keycode 118 = F789 keycode 119 = F890 keycode 120 = F991 keycode 121 = F1092 keycode 122 = F1193 keycode 123 = F1294 keycode 124 = F1395 keycode 125 = F1496 keycode 126 = F1597 keycode 127 = F1698 keycode 128 = F1799 keycode 129 = F18 100 keycode 130 = F19 101 keycode 131 = F20 102 keycode 132 = F21 103 keycode 133 = F22104 keycode 134 = F23105 keycode 135 = F24106 keycode 136 = Num_Lock107 keycode 137 = Scroll_Lock108 keycode 187 = acute grave109 keycode 188 = comma semicolon110 keycode 189 = minus underscore111 keycode 190 = period colon112 keycode 192 = numbersign apostrophe113 keycode 210 = plusminus hyphen macron114 keycode 211 =115 keycode 212 = copyright registered116 keycode 213 = guillemotleft guillemotright117 keycode 214 = masculine ordfeminine118 keycode 215 = ae AE119 keycode 216 = cent yen120 keycode 217 = questiondown exclamdown121 keycode 218 = onequarter onehalf threequarters 122 keycode 220 = less greater bar123 keycode 221 = plus asterisk asciitilde124 keycode 227 = multiply division125126 keycode 228 = acircumflex Acircumflex 127 keycode 229 = ecircumflex Ecircumflex 128 keycode 230 = icircumflex Icircumflex 129 keycode 231 = ocircumflex Ocircumflex 130 keycode 232 = ucircumflex Ucircumflex 131 keycode 233 = ntilde Ntilde132 keycode 234 = yacute Yacute133 keycode 235 = oslash Ooblique134 keycode 236 = aring Aring135 keycode 237 = ccedilla Ccedilla136 keycode 238 = thorn THORN137 keycode 239 = eth ETH138 keycode 240 = diaeresis cedilla currency 139 keycode 241 = agrave Agrave atilde Atilde 140 keycode 242 = egrave Egrave141 keycode 243 = igrave Igrave142 keycode 244 = ograve Ograve otilde Otilde 143 keycode 245 = ugrave Ugrave144 keycode 246 = adiaeresis Adiaeresis145 keycode 247 = ediaeresis Ediaeresis146 keycode 248 = idiaeresis Idiaeresis147 keycode 249 = odiaeresis Odiaeresis148 keycode 250 = udiaeresis Udiaeresis149 keycode 251 = ssharp question backslash150 keycode 252 = asciicircum degree151 keycode 253 = 3 sterling152 keycode 254 = Mode_switch153154 使用event对象的keyCode属性判断输入的键值155 eg:if(event.keyCode==13)alert(“enter!”); 156 键值对应表157 A0X65 U 0X85158 B0X66V0X86159 C0X67W0X87160 D0X68X 0X88161 E0X69Y0X89162 F0X70Z0X90163 G0X7100X48164 H0X7210X49165 I 0X7320X50166 J 0X74 3 0X51167 K0X75 4 0X52168 L0X76 5 0X53169 M0X7760X54170 N0X78 7 0X55171 O0X79 8 0X56172 P0X80 9 0X57173 Q0X81ESC0X1B174 R0X82CTRL 0X11175 S0X83SHIFT0X10176 T0X84ENTER0XD177178如果要使用组合键,则可以利用event.ctrlKey,event.shiftKey,event .altKey判断是否按下了ctrl键、shift 键以及alt键转自:经典文章网() - 详文链接:/zonghe/biancheng/65.html用VB编写键盘任意组合键(包括2、3、4键组合)在一些程序中,有一些快捷方式(如:Shift键最小化、ESC键退出、Ctrl+S存盘、Alt+x退出等等)。

KeyCode常量(虚拟键码)

KeyCode常量(虚拟键码)
F1 键 F2 键 F3 键 F4 键 F5 键 F6 键 F7 键 F8 键 F9 键 F10 键 F11 键 F12 键 F13 键 F14 键 F15 键 F16 键
KeyCode 常量

十进制
(16进制) (vba返回值)
0x1
1
0x2
2
0x3
3
0x4
4
0x8
8
0x9
9
0xC
12
0xD
13
0x10
16
0x11
17
0x12
18
0x13
19
0x14
20
0x1B
27
0x20
32
0x21
33
0x22
34
0x23
35
0x24
36
0x25
37
0x26
38
0x27
39
0x28
A-Z键
0-9键
0键 1键 2键 3键 4键 5键 6键
vbKeyNumpad7
0x67
103
vbKeyNumpad8
0x68
104
vbKeyNumpad9
0x69
105
vbKeyMultiply
0x6A
106
vbKeyAdd
0x6B
107
vbKeySeparator
0x6C
108
vbKeySubtract
A-z 键:A 键 到 Z 键与–z 的 ASCII 等效
vbKeyA-Z
0键-9 键:0键 到9键与它们的 ASCII 等价
vbKey0-9 数字键盘键 vbKeyNumpad0 vbKeyNumpad1 vbKeyNumpad2 vbKeyNumpad3 vbKeyNumpad4 vbKeyNumpad5 vbKeyNumpad6

VB键盘常量大全256个虚拟键码

VB键盘常量大全256个虚拟键码

Public Const VK_LBUTTON = &H1 Public Const VK_RBUTTON = &H2 Public Const VK_CANCEL = &H3 Public Const VK_MBUTTON = &H4 Public Const VK_BACK = &H8 Public Const VK_TAB = &H9Public Const VK_CLEAR = &HC Public Const VK_RETURN = &HD Public Const VK_SHIFT = &H10 Public Const VK_CONTROL = &H11 Public Const VK_MENU = &H12 Public Const VK_PAUSE = &H13 Public Const VK_CAPITAL = &H14 Public Const VK_ESCAPE = &H1B Public Const VK_SPACE = &H20 Public Const VK_PRIOR = &H21 Public Const VK_NEXT = &H22 Public Const VK_END = &H23 Public Const VK_HOME = &H24 Public Const VK_LEFT = &H25 Public Const VK_UP = &H26Public Const VK_RIGHT = &H27 Public Const VK_DOWN = &H28 Public Const VK_Select = &H29 Public Const VK_PRINT = &H2A Public Const VK_EXECUTE = &H2B Public Const VK_SNAPSHOT = &H2C Public Const VK_Insert = &H2D Public Const VK_Delete = &H2E Public Const VK_HELP = &H2F Public Const VK_0 = &H30Public Const VK_1 = &H31Public Const VK_2 = &H32Public Const VK_3 = &H33Public Const VK_4 = &H34Public Const VK_5 = &H35Public Const VK_6 = &H36Public Const VK_7 = &H37Public Const VK_8 = &H38Public Const VK_9 = &H39Public Const VK_A = &H41Public Const VK_B = &H42Public Const VK_C = &H43Public Const VK_D = &H44Public Const VK_F = &H46Public Const VK_G = &H47Public Const VK_H = &H48Public Const VK_I = &H49Public Const VK_J = &H4APublic Const VK_K = &H4BPublic Const VK_L = &H4CPublic Const VK_M = &H4DPublic Const VK_N = &H4EPublic Const VK_O = &H4FPublic Const VK_P = &H50Public Const VK_Q = &H51Public Const VK_R = &H52Public Const VK_S = &H53Public Const VK_T = &H54Public Const VK_U = &H55Public Const VK_V = &H56Public Const VK_W = &H57Public Const VK_X = &H58Public Const VK_Y = &H59Public Const VK_Z = &H5APublic Const VK_STARTKEY = &H5B Public Const VK_CONTEXTKEY = &H5D Public Const VK_NUMPAD0 = &H60 Public Const VK_NUMPAD1 = &H61 Public Const VK_NUMPAD2 = &H62 Public Const VK_NUMPAD3 = &H63 Public Const VK_NUMPAD4 = &H64 Public Const VK_NUMPAD5 = &H65 Public Const VK_NUMPAD6 = &H66 Public Const VK_NUMPAD7 = &H67 Public Const VK_NUMPAD8 = &H68 Public Const VK_NUMPAD9 = &H69 Public Const VK_MULTIPLY = &H6A Public Const VK_ADD = &H6BPublic Const VK_SEPARATOR = &H6C Public Const VK_SUBTRACT = &H6D Public Const VK_DECIMAL = &H6E Public Const VK_DIVIDE = &H6FPublic Const VK_F1 = &H70Public Const VK_F2 = &H71Public Const VK_F3 = &H72Public Const VK_F4 = &H73Public Const VK_F6 = &H75Public Const VK_F7 = &H76Public Const VK_F8 = &H77Public Const VK_F9 = &H78Public Const VK_F10 = &H79Public Const VK_F11 = &H7APublic Const VK_F12 = &H7BPublic Const VK_F13 = &H7CPublic Const VK_F14 = &H7DPublic Const VK_F15 = &H7EPublic Const VK_F16 = &H7FPublic Const VK_F17 = &H80Public Const VK_F18 = &H81Public Const VK_F19 = &H82Public Const VK_F20 = &H83Public Const VK_F21 = &H84Public Const VK_F22 = &H85Public Const VK_F23 = &H86Public Const VK_F24 = &H87Public Const VK_NUMLOCK = &H90 Public Const VK_OEM_SCROLL = &H91 Public Const VK_OEM_1 = &HBA Public Const VK_OEM_PLUS = &HBB Public Const VK_OEM_COMMA = &HBC Public Const VK_OEM_MINUS = &HBD Public Const VK_OEM_PERIOD = &HBE Public Const VK_OEM_2 = &HBFPublic Const VK_OEM_3 = &HC0Public Const VK_OEM_4 = &HDB Public Const VK_OEM_5 = &HDC Public Const VK_OEM_6 = &HDD Public Const VK_OEM_7 = &HDE Public Const VK_OEM_8 = &HDFPublic Const VK_ICO_F17 = &HE0 Public Const VK_ICO_F18 = &HE1 Public Const VK_OEM102 = &HE2 Public Const VK_ICO_HELP = &HE3 Public Const VK_ICO_00 = &HE4Public Const VK_ICO_CLEAR = &HE6 Public Const VK_OEM_RESET = &HE9 Public Const VK_OEM_JUMP = &HEA Public Const VK_OEM_PA1 = &HEB Public Const VK_OEM_PA2 = &HEC。

VB中的按键码

VB中的按键码

vbKeyLButton 1 鼠标左键vbKeyRButton 2 鼠标右键vbKeyCancel 3 CANCEL 键vbKeyMButton 4 鼠标中键vbKeyBack 8 BACKSPACE 键vbKeyTab 9 TAB 键vbKeyClear 12 CLEAR 键vbKeyReturn 13 ENTER 键vbKeyShift 16 SHIFT 键vbKeyControl 17 CTRL 键vbKeyMenu 18 菜单键vbKeyPause 19 PAUSE 键vbKeyCapital 20 CAPS LOCK 键vbKeyEscape 27 ESC 键vbKeySpace 32 SPACEBAR 键vbKeyPageUp 33 PAGEUP 键vbKeyPageDown 34 PAGEDOWN 键vbKeyEnd 35 END 键vbKeyHome 36 HOME 键vbKeyLeft 37 LEFT ARROW 键vbKeyUp 38 UP ARROW 键vbKeyRight 39 RIGHT ARROW 键vbKeyDown 40 DOWN ARROW 键vbKeySelect 41 SELECT 键vbKeyPrint 42 PRINT SCREEN 键vbKeyExecute 43 EXECUTE 键vbKeySnapshot 44 SNAP SHOT 键vbKeyInser 45 INS 键vbKeyDelete 46 DEL 键vbKeyHelp 47 HELP 键vbKeyNumlock 144 NUM LOCK 键A 键到Z 键与其ASCII 码的相应值'A' 到'Z' 是一致的常数值描述vbKeyA 65 A 键vbKeyB 66 B 键vbKeyC 67 C 键vbKeyD 68 D 键vbKeyE 69 E 键vbKeyF 70 F 键vbKeyG 71 G 键vbKeyH 72 H 键vbKeyI 73 I 键vbKeyJ 74 J 键vbKeyK 75 K 键vbKeyL 76 L 键vbKeyM 77 M 键vbKeyN 78 N 键vbKeyO 79 O 键vbKeyP 80 P 键vbKeyQ 81 Q 键vbKeyR 82 R 键vbKeyS 83 S 键vbKeyT 84 T 键vbKeyU 85 U 键vbKeyV 86 V 键vbKeyW 87 W 键vbKeyX 88 X 键vbKeyY 89 Y 键vbKeyZ 90 Z 键0 键到9 键与其ASCII 码的相应值'0' 到'9' 是一致的常数值描述vbKey0 48 0 键vbKey1 49 1 键vbKey2 50 2 键vbKey3 51 3 键vbKey4 52 4 键vbKey5 53 5 键vbKey6 54 6 键vbKey7 55 7 键vbKey8 56 8 键vbKey9 57 9 键数字小键盘上的键常数值描述vbKeyNumpad0 96 0 键vbKeyNumpad1 97 1 键vbKeyNumpad2 98 2 键vbKeyNumpad3 99 3 键vbKeyNumpad4 100 4 键vbKeyNumpad5 101 5 键vbKeyNumpad6 102 6 键vbKeyNumpad7 103 7 键vbKeyNumpad8 104 8 键vbKeyNumpad9 105 9 键vbKeyMultiply 106 乘号(*) 键vbKeyAdd 107 加号(+) 键vbKeySeparator 108 ENTER 键(在数字小键盘上)vbKeySubtract 109 减号(-) 键vbKeyDecimal 110 小数点(.) 键vbKeyDivide 111 除号(/) 键功能键常数值描述vbKeyF1 112 F1 键vbKeyF2 113 F2 键vbKeyF3 114 F3 键vbKeyF4 115 F4 键vbKeyF5 116 F5 键vbKeyF6 117 F6 键vbKeyF7 118 F7 键vbKeyF8 119 F8 键vbKeyF9 120 F9 键vbKeyF10 121 F10 键vbKeyF11 122 F11 键vbKeyF12 123 F12 键vbKeyF13 124 F13 键vbKeyF14 125 F14 键vbKeyF15 126 F15 键vbKeyF16 127 F16 键。

Visual Basic变量、常数和数据类型及过程概述

Visual Basic变量、常数和数据类型及过程概述
'设置 Module2 的 intX 变量的值。intX = End Sub在窗体模块中声明了第三个变量 intX。名为 Test 的过程又一次设置它的值。Public intX As Integer'声明了该窗体的 intX 变量。Sub Test ()' 设置 form 中的 intX 变量值。intX = 3End Sub在三个命令按钮的 Click 事件过程中,每一个都调用了相应的 Test 过程,并用 MsgBox 来显示这三个变量的值。Private Sub Command1_Click ()Module1.Test' 调用 Module1 中的 Test。MsgBox Module1.intX' 显示 Module1 的 intX。End SubPrivate Sub Command2_Click ()Module2.Test' 调用 Module2 中的 Test。MsgBox Module2.intX' 显示 Module2 的 intX。End SubPrivate Sub Command3_Click ()Test' 调用 Form1 中的 Test。MsgBox intX' 显示 Form1 的 intX。End Sub运行应用程序,单击三个命令按钮中的每一个按钮。于是将看到三个公用变量被分别引用。注意在第三个命令按钮的 Click 事件过程中,在调用Form1 的 Test 过程时不必指定 Form1.Test,在调用 Form1 的 Integer 变量的值时也不必指定 Form1.intX 。如果多个过程或变量同名,则VisualBasic 会取变化更受限制的值,在本例中就是 Form1 变量。公用变量与局部变量的比较在不同的范围内也可有同名的变量。例如,可有名为 Temp 的公用变量,然后在过程中声明名为 Temp 的局部变量。在过程内通过引用名字 Temp来访问局部变量;而在过程外则通过引用名字 Temp 来访问公用变量。通过用模块名限定模块级变量就可在过程内访问这样的变量。Public Temp As IntegerSub Test ()Dim Temp As IntegerTemp = 2' Temp 的值为 2。MsgBox Form1.Temp' Form1.Temp 的值为 1。End SubPrivate Sub Form_Load ()Temp = 1' 将 Form1.Temp 的值设置成 1。End SubPrivate Sub Command1_Click ()Test

VB中常用函数及有用的KeyAscii键码

VB中常用函数及有用的KeyAscii键码

VB中常用函数及有用的KeyAscii键码常用函数1.VAL()函数1.功能返回由数字组成的字符表达式的数字值.2.语法结构VAL(cExpression)其中,字符表达式最多由16位数字组成,若超过16位,则对其圆整.3.举例STORE'12'TO ASTORE'13'TO B?VAL(A)+VAL(B) 显示25.00★补充说明VAL()就是函数用于将数值字符串转换为数值。

即:将字符型(C)的数字符号转换为数值型(N)的数字符号.?VAL("1.234") &&结果为 1.23?VAL("A1.256") &&结果为0.00?VAL("1A.234") &&结果为 1.00但如果字符串内出现非字符型数据,那么只转换前面部分;如果字符串的首字符不是数字符号,则返回数值0,但忽略前导空格。

1.CStr()函数转化一个表达式为字符串.表达式CStr(expression)允许数据类型: expression 是任何有效的表达式。

实例:<%s = 3 + 2response.write "The 返回结果is: " & cStr(s)%>返回结果: 转化数字“5”为字符“5”。

2.VB使用Str()与CStr()的区别两个函数都是可以把数值转换成字符串不相同的是Str()返回的值是以String类型表示的数值(带符号位)Str转换后的字符串前后都带空格Str转换的原类型只能是数值CStr()除了可以转换数值类型还可以转换其他的类型如Boolean,Error类型等3.VB中的数据类型a)数据类型概述数据:计算机能够处理数值、文字、声音、图形、图像等信息,均称为数据。

数据类型:根据数据描述信息的含义,将数据分为不同的种类,对数据种类的区分规定,称为数据类型。

VB的keycode和keyascii大全及应用

VB的keycode和keyascii大全及应用

VB的keycode和keyascii大全及应用Vb的keycode和keyasciiVB KeyCode 常数表常数值描述常数值描述vbKeyLButton 0x1 鼠标左键vbKeyT 84 T 键vbKeyRButton 0x2 鼠标右键vbKeyU 85 U 键vbKeyCancel 0x3 CANCEL 键vbKeyV 86 V 键vbKeyMButton 0x4 鼠标中键vbKeyW 87 W 键vbKeyBack 0x8 BACKSPACE 键vbKeyX 88 X 键vbKeyTab 0x9 TAB 键vbKeyY 89 Y 键vbKeyClear 0xC CLEAR 键vbKeyZ 90 Z 键vbKeyReturn 0xD ENTER 键vbKeyShift 0x10 SHIFT 键vbKey0 48 0 键vbKeyControl 0x11 CTRL 键vbKey1 49 1 键vbKeyMenu 0x12 MENU 键vbKey2 50 2 键vbKeyPause 0x13 PAUSE 键vbKey3 51 3 键vbKeyCapital 0x14 CAPS LOCK 键vbKey4 52 4 键vbKeyEscape 0x1B ESC 键vbKey5 53 5 键vbKeySpace 0x20 SPACEBAR 键vbKey6 54 6 键vbKeyPageUp 0x21 PAGE UP 键vbKey7 55 7 键vbKeyEnd 0x23 END 键vbKey8 56 8 键vbKeyHome 0x24 HOME 键vbKey9 57 9 键vbKeyLeft 0x25 LEFT ARROW 键vbKeyUp 0x26 UP ARROW 键vbKeyRight 0x27 RIGHT ARROW 键vbKeyNumpad0 0x60 0 键vbKeyDown 0x28 DOWN ARROW 键vbKeyNumpad1 0x61 1 键vbKeySelect 0x29 SELECT 键vbKeyNumpad2 0x62 2 键vbKeyPrint 0x2A PRINT SCREEN 键vbKeyNumpad3 0x63 3 键vbKeyExecute 0x2B EXECUTE 键vbKeyNumpad4 0x64 4 键vbKeySnapshot 0x2C SNAPSHOT 键vbKeyNumpad5 0x65 5 键vbKeyDelete 0x2E DELETE 键vbKeyNumpad6 0x66 6 键vbKeyHelp 0x2F HELP 键vbKeyNumpad7 0x67 7 键vbKeyNumlock 0x90 NUM LOCK 键vbKeyNumpad8 0x68 8 键vbKeyNumpad9 0x69 9 键vbKeyA 65 A 键vbKeyMultiply 0x6A MULTIPLICATIONSIGN(*) vbKeyB 66 B 键vbKeyAdd 0x6B PLUS SIGN (+) 键vbKeyC 67 C 键vbKeySeparator 0x6C ENTER 键vbKeyD 68 D 键vbKeySubtract 0x6D MINUS SIGN (-) 键vbKeyE 69 E 键vbKeyDecimal 0x6E DECIMAL POINT (.) 键vbKeyF 70 F 键vbKeyDivide 0x6F DIVISION SIGN (/) 键vbKeyG 71 G 键vbKeyH 72 H 键vbKeyF1 0x70 F1 键vbKeyI 73 I 键vbKeyF2 0x71 F2 键vbKeyJ 74 J 键vbKeyF3 0x72 F3 键vbKeyK 75 K 键vbKeyF4 0x73 F4 键vbKeyL 76 L 键vbKeyF5 0x74 F5 键vbKeyM 77 M 键vbKeyF6 0x75 F6 键vbKeyN 78 N 键vbKeyF7 0x76 F7 键vbKeyO 79 O 键vbKeyF8 0x77 F8 键vbKeyP 80 P 键vbKeyF9 0x78 F9 键vbKeyQ 81 Q 键vbKeyF10 0x79 F10 键vbKeyR 82 R 键vbKeyF11 0x7A F11 键vbKeyS 83 S 键vbKeyF12 0x7B F12 键Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)Me.ClsPrint Chr$(KeyCode); KeyCodeEnd SubPrivate Sub Form_KeyDown(KeyAscii As Integer, Shift As Integer)Me.ClsPrint Chr$(KeyAscii); KeyAsciiEnd SubASCII码对照表ASCII, American Standard Code for Information Interchange 念起來像是"阿斯key",定義從0 到127 的一百二十八個數字所代表的英文字母或數字或符號,所有使用ASCII 的電腦之間可以互相讀取同一份文件而不會有不一樣的結果與意義。

VB键盘常量大全个虚拟键码

VB键盘常量大全个虚拟键码

Public Const VK_LBUTTON = &H1 Public Const VK_RBUTTON = &H2 Public Const VK_CANCEL = &H3 Public Const VK_MBUTTON = &H4 Public Const VK_BACK = &H8 Public Const VK_TAB = &H9 Public Const VK_CLEAR = &HC Public Const VK_RETURN = &HD Public Const VK_SHIFT = &H10 Public Const VK_CONTROL = &H11 Public Const VK_MENU = &H12 Public Const VK_PAUSE = &H13 Public Const VK_CAPITAL = &H14 Public Const VK_ESCAPE = &H1B Public Const VK_SPACE = &H20 Public Const VK_PRIOR = &H21 Public Const VK_NEXT = &H22 Public Const VK_END = &H23 Public Const VK_HOME = &H24 Public Const VK_LEFT = &H25 Public Const VK_UP = &H26 Public Const VK_RIGHT = &H27 Public Const VK_DOWN = &H28 Public Const VK_Select = &H29 Public Const VK_PRINT = &H2A Public Const VK_EXECUTE = &H2BPublic Const VK_SNAPSHOT = &H2C Public Const VK_Insert = &H2D Public Const VK_Delete = &H2E Public Const VK_HELP = &H2F Public Const VK_0 = &H30Public Const VK_1 = &H31Public Const VK_2 = &H32Public Const VK_3 = &H33Public Const VK_4 = &H34Public Const VK_5 = &H35Public Const VK_6 = &H36Public Const VK_7 = &H37Public Const VK_8 = &H38Public Const VK_9 = &H39Public Const VK_A = &H41Public Const VK_B = &H42Public Const VK_C = &H43Public Const VK_D = &H44Public Const VK_E = &H45Public Const VK_F = &H46Public Const VK_G = &H47Public Const VK_H = &H48Public Const VK_I = &H49Public Const VK_J = &H4APublic Const VK_K = &H4BPublic Const VK_L = &H4CPublic Const VK_M = &H4DPublic Const VK_N = &H4EPublic Const VK_O = &H4FPublic Const VK_P = &H50Public Const VK_Q = &H51Public Const VK_R = &H52Public Const VK_S = &H53Public Const VK_T = &H54Public Const VK_U = &H55Public Const VK_V = &H56Public Const VK_W = &H57Public Const VK_X = &H58Public Const VK_Y = &H59Public Const VK_Z = &H5APublic Const VK_STARTKEY = &H5B Public Const VK_CONTEXTKEY = &H5D Public Const VK_NUMPAD0 = &H60 Public Const VK_NUMPAD1 = &H61 Public Const VK_NUMPAD2 = &H62 Public Const VK_NUMPAD3 = &H63 Public Const VK_NUMPAD4 = &H64 Public Const VK_NUMPAD5 = &H65 Public Const VK_NUMPAD6 = &H66 Public Const VK_NUMPAD7 = &H67 Public Const VK_NUMPAD8 = &H68 Public Const VK_NUMPAD9 = &H69Public Const VK_MULTIPLY = &H6A Public Const VK_ADD = &H6B Public Const VK_SEPARATOR = &H6C Public Const VK_SUBTRACT = &H6D Public Const VK_DECIMAL = &H6E Public Const VK_DIVIDE = &H6F Public Const VK_F1 = &H70Public Const VK_F2 = &H71Public Const VK_F3 = &H72Public Const VK_F4 = &H73Public Const VK_F5 = &H74Public Const VK_F6 = &H75Public Const VK_F7 = &H76Public Const VK_F8 = &H77Public Const VK_F9 = &H78Public Const VK_F10 = &H79 Public Const VK_F11 = &H7A Public Const VK_F12 = &H7B Public Const VK_F13 = &H7C Public Const VK_F14 = &H7D Public Const VK_F15 = &H7E Public Const VK_F16 = &H7F Public Const VK_F17 = &H80 Public Const VK_F18 = &H81 Public Const VK_F19 = &H82 Public Const VK_F20 = &H83Public Const VK_F21 = &H84Public Const VK_F22 = &H85Public Const VK_F23 = &H86Public Const VK_F24 = &H87Public Const VK_NUMLOCK = &H90 Public Const VK_OEM_SCROLL = &H91 Public Const VK_OEM_1 = &HBA Public Const VK_OEM_PLUS = &HBB Public Const VK_OEM_COMMA = &HBC Public Const VK_OEM_MINUS = &HBD Public Const VK_OEM_PERIOD = &HBE Public Const VK_OEM_2 = &HBF Public Const VK_OEM_3 = &HC0 Public Const VK_OEM_4 = &HDB Public Const VK_OEM_5 = &HDC Public Const VK_OEM_6 = &HDD Public Const VK_OEM_7 = &HDE Public Const VK_OEM_8 = &HDF Public Const VK_ICO_F17 = &HE0 Public Const VK_ICO_F18 = &HE1 Public Const VK_OEM102 = &HE2 Public Const VK_ICO_HELP = &HE3 Public Const VK_ICO_00 = &HE4 Public Const VK_ICO_CLEAR = &HE6 Public Const VK_OEM_RESET = &HE9 Public Const VK_OEM_JUMP = &HEAPublic Const VK_OEM_PA1 = &HEBPublic Const VK_OEM_PA2 = &HECPublic Const VK_OEM_PA3 = &HEDPublic Const VK_OEM_WSCTRL = &HEEPublic Const VK_OEM_CUSEL = &HEFPublic Const VK_OEM_ATTN = &HF0Public Const VK_OEM_FINNISH = &HF1Public Const VK_OEM_COPY = &HF2Public Const VK_OEM_AUTO = &HF3Public Const VK_OEM_ENLW = &HF4Public Const VK_OEM_BACKTAB = &HF5Public Const VK_ATTN = &HF6Public Const VK_CRSEL = &HF7Public Const VK_EXSEL = &HF8Public Const VK_EREOF = &HF9Public Const VK_PLAY = &HFAPublic Const VK_ZOOM = &HFBPublic Const VK_NONAME = &HFCPublic Const VK_PA1 = &HFDPublic Const VK_OEM_CLEAR = &HFE虚拟键码虚拟键码保存在WM_KEYDOWN、WM_KEYUP、WM_SYSKEYDOWN和WM_SYSKEYUP 讯息的wParam参数中。

(整理)键盘对应数字-keycode值大全

(整理)键盘对应数字-keycode值大全

键盘对应数字-keycode值大event.keycode值大全 1 keycode 8 = BackSpace BackSpace 2 keycode 9 = Tab Tab 3 keycode 12 = Clear 4 keycode 13 = Enter 5 keycode 16 = Shift_L 6 keycode 17 = Control_L 7 keycode 18 = Alt_L 8 keycode 19 = Pause 9 keycode 20 = Caps_Lock 10 keyevent.keycode值大全1 keycode 8 = BackSpace BackSpace2 keycode 9 = Tab Tab3 keycode 12 = Clear4 keycode 13 = Enter5 keycode 16 = Shift_L6 keycode 17 = Control_L7 keycode 18 = Alt_L8 keycode 19 = Pause9 keycode 20 = Caps_Lock10 keycode 27 = Escape Escape11 keycode 32 = space space12 keycode 33 = Prior13 keycode 34 = Next14 keycode 35 = End15 keycode 36 = Home17 keycode 38 = Up18 keycode 39 = Right19 keycode 40 = Down20 keycode 41 = Select21 keycode 42 = Print22 keycode 43 = Execute23 keycode 45 = Insert24 keycode 46 = Delete25 keycode 47 = Help26 keycode 48 = 0 equal braceright27 keycode 49 = 1 exclam onesuperior28 keycode 50 = 2 quotedbl twosuperior29 keycode 51 = 3 section threesuperior30 keycode 52 = 4 dollar31 keycode 53 = 5 percent32 keycode 54 = 6 ampersand33 keycode 55 = 7 slash braceleft34 keycode 56 = 8 parenleft bracketleft35 keycode 57 = 9 parenright bracketright36 keycode 65 = a A37 keycode 66 = b B39 keycode 68 = d D40 keycode 69 = e E EuroSign41 keycode 70 = f F4243 keycode 71 = g G44 keycode 72 = h H45 keycode 73 = i I46 keycode 74 = j J47 keycode 75 = k K48 keycode 76 = l L49 keycode 77 = m M mu50 keycode 78 = n N51 keycode 79 = o O52 keycode 80 = p P53 keycode 81 = q Q at54 keycode 82 = r R55 keycode 83 = s S56 keycode 84 = t T57 keycode 85 = u U58 keycode 86 = v V59 keycode 87 = w W61 keycode 89 = y Y62 keycode 90 = z Z63 keycode 96 = KP_0 KP_064 keycode 97 = KP_1 KP_165 keycode 98 = KP_2 KP_266 keycode 99 = KP_3 KP_367 keycode 100 = KP_4 KP_468 keycode 101 = KP_5 KP_569 keycode 102 = KP_6 KP_670 keycode 103 = KP_7 KP_771 keycode 104 = KP_8 KP_872 keycode 105 = KP_9 KP_973 keycode 106 = KP_Multiply KP_Multiply74 keycode 107 = KP_Add KP_Add7576 keycode 108 = KP_Separator KP_Separator77 keycode 109 = KP_Subtract KP_Subtract78 keycode 110 = KP_Decimal KP_Decimal79 keycode 111 = KP_Divide KP_Divide80 keycode 112 = F181 keycode 113 = F283 keycode 115 = F4848586 keycode 116 = F587 keycode 117 = F688 keycode 118 = F789 keycode 119 = F890 keycode 120 = F991 keycode 121 = F1092 keycode 122 = F1193 keycode 123 = F1294 keycode 124 = F1395 keycode 125 = F1496 keycode 126 = F1597 keycode 127 = F1698 keycode 128 = F1799 keycode 129 = F18 100 keycode 130 = F19 101 keycode 131 = F20 102 keycode 132 = F21 103 keycode 133 = F22104 keycode 134 = F23105 keycode 135 = F24106 keycode 136 = Num_Lock107 keycode 137 = Scroll_Lock108 keycode 187 = acute grave109 keycode 188 = comma semicolon110 keycode 189 = minus underscore111 keycode 190 = period colon112 keycode 192 = numbersign apostrophe113 keycode 210 = plusminus hyphen macron114 keycode 211 =115 keycode 212 = copyright registered116 keycode 213 = guillemotleft guillemotright117 keycode 214 = masculine ordfeminine118 keycode 215 = ae AE119 keycode 216 = cent yen120 keycode 217 = questiondown exclamdown121 keycode 218 = onequarter onehalf threequarters 122 keycode 220 = less greater bar123 keycode 221 = plus asterisk asciitilde124 keycode 227 = multiply division125126 keycode 228 = acircumflex Acircumflex 127 keycode 229 = ecircumflex Ecircumflex 128 keycode 230 = icircumflex Icircumflex 129 keycode 231 = ocircumflex Ocircumflex 130 keycode 232 = ucircumflex Ucircumflex 131 keycode 233 = ntilde Ntilde132 keycode 234 = yacute Yacute133 keycode 235 = oslash Ooblique134 keycode 236 = aring Aring135 keycode 237 = ccedilla Ccedilla136 keycode 238 = thorn THORN137 keycode 239 = eth ETH138 keycode 240 = diaeresis cedilla currency 139 keycode 241 = agrave Agrave atilde Atilde 140 keycode 242 = egrave Egrave141 keycode 243 = igrave Igrave142 keycode 244 = ograve Ograve otilde Otilde 143 keycode 245 = ugrave Ugrave144 keycode 246 = adiaeresis Adiaeresis145 keycode 247 = ediaeresis Ediaeresis146 keycode 248 = idiaeresis Idiaeresis147 keycode 249 = odiaeresis Odiaeresis148 keycode 250 = udiaeresis Udiaeresis149 keycode 251 = ssharp question backslash150 keycode 252 = asciicircum degree151 keycode 253 = 3 sterling152 keycode 254 = Mode_switch153154 使用event对象的keyCode属性判断输入的键值155 eg:if(event.keyCode==13)alert(“enter!”); 156 键值对应表157 A0X65 U 0X85158 B0X66V0X86159 C0X67W0X87160 D0X68X 0X88161 E0X69Y0X89162 F0X70Z0X90163 G0X7100X48164 H0X7210X49165 I 0X7320X50166 J 0X74 3 0X51167 K0X75 4 0X52168 L0X76 5 0X53169 M0X7760X54170 N0X78 7 0X55171 O0X79 8 0X56172 P0X80 9 0X57173 Q0X81ESC0X1B174 R0X82CTRL 0X11175 S0X83SHIFT0X10176 T0X84ENTER0XD177178如果要使用组合键,则可以利用event.ctrlKey,event.shiftKey,event .altKey判断是否按下了ctrl键、shift 键以及alt键转自:经典文章网() - 详文链接:/zonghe/biancheng/65.html用VB编写键盘任意组合键(包括2、3、4键组合)在一些程序中,有一些快捷方式(如:Shift键最小化、ESC键退出、Ctrl+S存盘、Alt+x退出等等)。

vbkey--键码

vbkey--键码

键码常数值描述vbKeyLButton 1 鼠标左键vbKeyRButton 2 鼠标右键vbKeyCancel 3 CANCEL 键vbKeyMButton 4 鼠标中键vbKeyBack 8 BACKSPACE 键vbKeyTab 9 TAB 键vbKeyClear 12 CLEAR 键vbKeyReturn 13 ENTER 键vbKeyShift 16 SHIFT 键vbKeyControl 17 CTRL 键vbKeyMenu 18 菜单键vbKeyPause 19 PAUSE 键vbKeyCapital 20 CAPS LOCK 键vbKeyEscape 27 ESC 键vbKeySpace 32 SPACEBAR 键vbKeyPageUp 33 PAGEUP 键vbKeyPageDown 34 PAGEDOWN 键vbKeyEnd 35 END 键vbKeyHome 36 HOME 键vbKeyLeft 37 LEFT ARROW 键vbKeyUp 38 UP ARROW 键vbKeyRight 39 RIGHT ARROW 键vbKeyDown 40 DOWN ARROW 键vbKeySelect 41 SELECT 键vbKeyPrint 42 PRINT SCREEN 键vbKeyExecute 43 EXECUTE 键vbKeySnapshot 44 SNAP SHOT 键vbKeyInser 45 INS 键vbKeyDelete 46 DEL 键vbKeyHelp 47 HELP 键vbKeyNumlock 144 NUM LOCK 键A 键到Z 键与其ASCII 码的相应值'A' 到'Z' 是一致的常数值描述vbKeyA 65 A 键vbKeyB 66 B 键vbKeyC 67 C 键vbKeyD 68 D 键vbKeyE 69 E 键vbKeyF 70 F 键vbKeyG 71 G 键vbKeyH 72 H 键vbKeyI 73 I 键vbKeyJ 74 J 键vbKeyK 75 K 键vbKeyL 76 L 键vbKeyM 77 M 键vbKeyN 78 N 键vbKeyO 79 O 键vbKeyP 80 P 键vbKeyQ 81 Q 键vbKeyR 82 R 键vbKeyS 83 S 键vbKeyT 84 T 键vbKeyU 85 U 键vbKeyV 86 V 键vbKeyW 87 W 键vbKeyX 88 X 键vbKeyY 89 Y 键vbKeyZ 90 Z 键0 键到9 键与其ASCII 码的相应值'0' 到'9' 是一致的常数值描述vbKey0 48 0 键vbKey1 49 1 键vbKey2 50 2 键vbKey3 51 3 键vbKey4 52 4 键vbKey5 53 5 键vbKey6 54 6 键vbKey7 55 7 键vbKey8 56 8 键vbKey9 57 9 键数字小键盘上的键常数值描述vbKeyNumpad0 96 0 键vbKeyNumpad1 97 1 键vbKeyNumpad2 98 2 键vbKeyNumpad3 99 3 键vbKeyNumpad4 100 4 键vbKeyNumpad5 101 5 键vbKeyNumpad6 102 6 键vbKeyNumpad7 103 7 键vbKeyNumpad8 104 8 键vbKeyNumpad9 105 9 键vbKeyMultiply 106 乘号(*) 键vbKeyAdd 107 加号(+) 键vbKeySeparator 108 ENTER 键(在数字小键盘上)vbKeySubtract 109 减号(-) 键vbKeyDecimal 110 小数点(.) 键vbKeyDivide 111 除号(/) 键功能键常数值描述vbKeyF1 112 F1 键vbKeyF2 113 F2 键vbKeyF3 114 F3 键vbKeyF4 115 F4 键vbKeyF5 116 F5 键vbKeyF6 117 F6 键vbKeyF7 118 F7 键vbKeyF8 119 F8 键vbKeyF9 120 F9 键vbKeyF10 121 F10 键vbKeyF11 122 F11 键vbKeyF12 123 F12 键vbKeyF13 124 F13 键vbKeyF14 125 F14 键vbKeyF15 126 F15 键vbKeyF16 127 F16 键回答者:hxf0663|六级| 2008-7-8 16:59vbKeyA 就是65回答者:Worsley_Barbar|六级| 2008-7-8 17:00这个是不需要转化的,例如vbKeyA之类是VB提供的内部常量.也就是说vbKeyA 和65是完全相等的,即使用vbKeyA代入到算式中起到的作用也是和65是一样的.是一个一位两面体.既然是一位两面体也就无所谓转化了.下面就是这些常量了.vbKeyLButton 1 鼠标左键vbKeyRButton 2 鼠标右键vbKeyCancel 3 CANCEL 键vbKeyMButton 4 鼠标中键vbKeyBack 8 BACKSPACE 键vbKeyTab 9 TAB 键vbKeyClear 12 CLEAR 键vbKeyReturn 13 ENTER 键vbKeyShift 16 SHIFT 键vbKeyControl 17 CTRL 键vbKeyMenu 18 菜单键vbKeyPause 19 PAUSE 键vbKeyCapital 20 CAPS LOCK 键vbKeyEscape 27 ESC 键vbKeySpace 32 SPACEBAR 键vbKeyPageUp 33 PAGEUP 键vbKeyPageDown 34 PAGEDOWN 键vbKeyEnd 35 END 键vbKeyHome 36 HOME 键vbKeyLeft 37 LEFT ARROW 键vbKeyUp 38 UP ARROW 键vbKeyRight 39 RIGHT ARROW 键vbKeyDown 40 DOWN ARROW 键vbKeySelect 41 SELECT 键vbKeyPrint 42 PRINT SCREEN 键vbKeyExecute 43 EXECUTE 键vbKeySnapshot 44 SNAP SHOT 键vbKeyInser 45 INS 键vbKeyDelete 46 DEL 键vbKeyHelp 47 HELP 键vbKeyNumlock 144 NUM LOCK 键A 键到Z 键与其ASCII 码的相应值'A' 到'Z' 是一致的常数值描述vbKeyA 65 A 键vbKeyB 66 B 键vbKeyC 67 C 键vbKeyD 68 D 键vbKeyE 69 E 键vbKeyF 70 F 键vbKeyG 71 G 键vbKeyH 72 H 键vbKeyI 73 I 键vbKeyJ 74 J 键vbKeyK 75 K 键vbKeyL 76 L 键vbKeyM 77 M 键vbKeyN 78 N 键vbKeyO 79 O 键vbKeyP 80 P 键vbKeyQ 81 Q 键vbKeyR 82 R 键vbKeyS 83 S 键vbKeyT 84 T 键vbKeyU 85 U 键vbKeyV 86 V 键vbKeyW 87 W 键vbKeyX 88 X 键vbKeyY 89 Y 键vbKeyZ 90 Z 键0 键到9 键与其ASCII 码的相应值'0' 到'9' 是一致的常数值描述vbKey0 48 0 键vbKey1 49 1 键vbKey2 50 2 键vbKey3 51 3 键vbKey4 52 4 键vbKey5 53 5 键vbKey6 54 6 键vbKey7 55 7 键vbKey8 56 8 键vbKey9 57 9 键数字小键盘上的键常数值描述vbKeyNumpad0 96 0 键vbKeyNumpad1 97 1 键vbKeyNumpad2 98 2 键vbKeyNumpad3 99 3 键vbKeyNumpad4 100 4 键vbKeyNumpad5 101 5 键vbKeyNumpad6 102 6 键vbKeyNumpad7 103 7 键vbKeyNumpad8 104 8 键vbKeyNumpad9 105 9 键vbKeyMultiply 106 乘号(*) 键vbKeyAdd 107 加号(+) 键vbKeySeparator 108 ENTER 键(在数字小键盘上)vbKeySubtract 109 减号(-) 键vbKeyDecimal 110 小数点(.) 键vbKeyDivide 111 除号(/) 键功能键常数值描述vbKeyF1 112 F1 键vbKeyF2 113 F2 键vbKeyF3 114 F3 键vbKeyF4 115 F4 键vbKeyF5 116 F5 键vbKeyF6 117 F6 键vbKeyF7 118 F7 键vbKeyF8 119 F8 键vbKeyF9 120 F9 键vbKeyF10 121 F10 键vbKeyF11 122 F11 键vbKeyF12 123 F12 键vbKeyF13 124 F13 键vbKeyF14 125 F14 键vbKeyF15 126 F15 键vbKeyF16 127 F16 键。

VB键盘常量大全 256个虚拟键码

VB键盘常量大全 256个虚拟键码

Public Const VK_LBUTTON = &H1 Public Const VK_RBUTTON = &H2 Public Const VK_CANCEL = &H3 Public Const VK_MBUTTON = &H4 Public Const VK_BACK = &H8 Public Const VK_TAB = &H9Public Const VK_CLEAR = &HC Public Const VK_RETURN = &HD Public Const VK_SHIFT = &H10 Public Const VK_CONTROL = &H11 Public Const VK_MENU = &H12 Public Const VK_PAUSE = &H13 Public Const VK_CAPITAL = &H14 Public Const VK_ESCAPE = &H1B Public Const VK_SPACE = &H20 Public Const VK_PRIOR = &H21 Public Const VK_NEXT = &H22 Public Const VK_END = &H23 Public Const VK_HOME = &H24 Public Const VK_LEFT = &H25 Public Const VK_UP = &H26Public Const VK_RIGHT = &H27 Public Const VK_DOWN = &H28 Public Const VK_Select = &H29 Public Const VK_PRINT = &H2A Public Const VK_EXECUTE = &H2B Public Const VK_SNAPSHOT = &H2C Public Const VK_Insert = &H2D Public Const VK_Delete = &H2E Public Const VK_HELP = &H2F Public Const VK_0 = &H30Public Const VK_1 = &H31Public Const VK_2 = &H32Public Const VK_3 = &H33Public Const VK_4 = &H34Public Const VK_5 = &H35Public Const VK_6 = &H36Public Const VK_7 = &H37Public Const VK_8 = &H38Public Const VK_9 = &H39Public Const VK_A = &H41Public Const VK_B = &H42Public Const VK_C = &H43Public Const VK_D = &H44Public Const VK_F = &H46Public Const VK_G = &H47Public Const VK_H = &H48Public Const VK_I = &H49Public Const VK_J = &H4APublic Const VK_K = &H4BPublic Const VK_L = &H4CPublic Const VK_M = &H4DPublic Const VK_N = &H4EPublic Const VK_O = &H4FPublic Const VK_P = &H50Public Const VK_Q = &H51Public Const VK_R = &H52Public Const VK_S = &H53Public Const VK_T = &H54Public Const VK_U = &H55Public Const VK_V = &H56Public Const VK_W = &H57Public Const VK_X = &H58Public Const VK_Y = &H59Public Const VK_Z = &H5APublic Const VK_STARTKEY = &H5B Public Const VK_CONTEXTKEY = &H5D Public Const VK_NUMPAD0 = &H60 Public Const VK_NUMPAD1 = &H61 Public Const VK_NUMPAD2 = &H62 Public Const VK_NUMPAD3 = &H63 Public Const VK_NUMPAD4 = &H64 Public Const VK_NUMPAD5 = &H65 Public Const VK_NUMPAD6 = &H66 Public Const VK_NUMPAD7 = &H67 Public Const VK_NUMPAD8 = &H68 Public Const VK_NUMPAD9 = &H69 Public Const VK_MULTIPLY = &H6A Public Const VK_ADD = &H6BPublic Const VK_SEPARATOR = &H6C Public Const VK_SUBTRACT = &H6D Public Const VK_DECIMAL = &H6E Public Const VK_DIVIDE = &H6FPublic Const VK_F1 = &H70Public Const VK_F2 = &H71Public Const VK_F3 = &H72Public Const VK_F4 = &H73Public Const VK_F6 = &H75Public Const VK_F7 = &H76Public Const VK_F8 = &H77Public Const VK_F9 = &H78Public Const VK_F10 = &H79Public Const VK_F11 = &H7APublic Const VK_F12 = &H7BPublic Const VK_F13 = &H7CPublic Const VK_F14 = &H7DPublic Const VK_F15 = &H7EPublic Const VK_F16 = &H7FPublic Const VK_F17 = &H80Public Const VK_F18 = &H81Public Const VK_F19 = &H82Public Const VK_F20 = &H83Public Const VK_F21 = &H84Public Const VK_F22 = &H85Public Const VK_F23 = &H86Public Const VK_F24 = &H87Public Const VK_NUMLOCK = &H90 Public Const VK_OEM_SCROLL = &H91 Public Const VK_OEM_1 = &HBA Public Const VK_OEM_PLUS = &HBB Public Const VK_OEM_COMMA = &HBC Public Const VK_OEM_MINUS = &HBD Public Const VK_OEM_PERIOD = &HBE Public Const VK_OEM_2 = &HBFPublic Const VK_OEM_3 = &HC0Public Const VK_OEM_4 = &HDB Public Const VK_OEM_5 = &HDC Public Const VK_OEM_6 = &HDD Public Const VK_OEM_7 = &HDE Public Const VK_OEM_8 = &HDFPublic Const VK_ICO_F17 = &HE0 Public Const VK_ICO_F18 = &HE1 Public Const VK_OEM102 = &HE2 Public Const VK_ICO_HELP = &HE3 Public Const VK_ICO_00 = &HE4Public Const VK_ICO_CLEAR = &HE6 Public Const VK_OEM_RESET = &HE9 Public Const VK_OEM_JUMP = &HEA Public Const VK_OEM_PA1 = &HEB Public Const VK_OEM_PA2 = &HECPublic Const VK_OEM_PA3 = &HEDPublic Const VK_OEM_WSCTRL = &HEEPublic Const VK_OEM_CUSEL = &HEFPublic Const VK_OEM_A TTN = &HF0Public Const VK_OEM_FINNISH = &HF1Public Const VK_OEM_COPY = &HF2Public Const VK_OEM_AUTO = &HF3Public Const VK_OEM_ENLW = &HF4Public Const VK_OEM_BACKTAB = &HF5Public Const VK_ATTN = &HF6Public Const VK_CRSEL = &HF7Public Const VK_EXSEL = &HF8Public Const VK_EREOF = &HF9Public Const VK_PLAY = &HFAPublic Const VK_ZOOM = &HFBPublic Const VK_NONAME = &HFCPublic Const VK_PA1 = &HFDPublic Const VK_OEM_CLEAR = &HFE虚拟键码虚拟键码保存在WM_KEYDOWN、WM_KEYUP、WM_SYSKEYDOWN和WM_SYSKEYUP 讯息的wParam参数中。

vb指令集1

vb指令集1

Calendar 常数: vbCalGreg vbCalHijriColor 常数: vbBlack vbRed vbGreen vbYellow vbBlue vbMagenta vbCyan vbWhiteComparison常数: VbUseCompareOption VbBinaryCompare VbTextComparevbDatabaseCompareCompiler 常数: Win16 Win32Date 常数: vbUseSystem vbSunday vbMonday vbTuesday vbWednesdayvbThursday vbFriday vbSaturdayfirstdayofyear: vbUseSystem VbUseSystemDayOfWeek VbFirstJan1vbFirstFourDays vbFirstFullWeek返回值: vbSunday vbMonday vbTuesday vbWednesdayvbThursday vbFriday vbSaturday日期格式常数: vbGeneralDate vbLongDate vbShortDate vbLongTimevbShortTimeDir、GetAttr 和 SetAttr 常数: vbNormal vbReadOnly vbHidden vbSystemvbVolume vbDirectory vbArchive驱动器类型常数: Unknown Removable Fixed Remote CDROM RAMDisk文件属性常数: Normal ReadOnly Hidden System Volume DirectoryArchive Alias Compressed文件输入/输出常数: ForReading ForWriting ForAppendingIMEStatus 常数: vbIMEModeNoControl vbIMEModeOn vbIMEModeOffvbIMEModeDisable vbIMEModeHiragana vbIMEModeKatakana vbIMEModeKatakanaHalf vbIMEModeAlphaFull vbIMEModeAlpha Keycode 常数: vbKeyLButton vbKeyRButton vbKeyCancel vbKeyMButtonvbKeyBack vbKeyTab vbKeyClear vbKeyReturn vbKeyShift vbKeyControl vbKeyMenu vbKeyPause vbKeyCapital vbKeyEscape vbKeySpace vbKeyPageUp vbKeyPageDownvbKeyEnd vbKeyHome vbKeyLeft vbKeyUp vbKeyRightvbKeyDown vbKeySelect vbKeyPrint vbKeyExecutevbKeySnapshot vbKeyInsert vbKeyDelete vbKeyHelpvbKeyNumlockvbKeyA vbKeyB vbKeyC vbKeyD vbKeyE vbKeyF vbKeyG vbKeyH vbKeyI vbKeyJ vbKeyK vbKeyL vbKeyM vbKeyNvbKeyO vbKeyP vbKeyQ vbKeyR vbKeyS vbKeyT vbKeyU vbKeyV vbKeyW vbKeyX vbKeyY vbKeyZvbKey0 vbKey1 vbKey2 vbKey3 vbKey4 vbKey5 vbKey6vbKey7 vbKey8 vbKey9vbKeyNumpad0 vbKeyNumpad1 vbKeyNumpad2 vbKeyNumpad3 vbKeyNumpad4 vbKeyNumpad5 vbKeyNumpad6 vbKeyNumpad7 vbKeyNumpad8 vbKeyNumpad9 vbKeyMultiply vbKeyAdd vbKeySeparator vbKeySubtract vbKeyDecimal vbKeyDivide vbKeyF1 vbKeyF2 vbKeyF3 vbKeyF4 vbKeyF5 vbKeyF6vbKeyF7 vbKeyF8 vbKeyF9 vbKeyF10 vbKeyF11 vbKeyF12 vbKeyF13 vbKeyF14 vbKeyF15 vbKeyF16Miscellaneous 常数: vbCrLf vbCr vbLf vbNewLine vbNullCharvbNullString vbObjectError vbTab vbBackvbFormFeed vbVerticalTabMsgBox 常数: vbOKOnly vbOKCancel vbAbortRetryIgnore vbYesNoCancelvbYesNo vbRetryCancel vbCritical vbQuestionvbExclamation vbDefaultButton1 vbDefaultButton2vbDefaultButton3 vbDefaultButton4 vbApplicationModalvbSystemModal vbMsgBoxHelpButton VbMsgBoxSetForeground vbMsgBoxRight vbMsgBoxRtlReadingvbOK vbCancel vbAbort vbRetry vbIgnore vbYes vbNo QueryClose常数: vbFormControlMenu vbFormCode vbAppWindowsvbAppTaskManagerShell 常数: vbHide vbNormalFocus vbMinimizedFocus vbMaximizedFocus vbNormalNoFocus vbMinimizeNoFocus特殊文件夹常数: WindowsFolder SystemFolder TemporaryFolderStrConv 常数: vbUpperCase vbLowerCase vbProperCase vbWide vbNarrow vbKatakana vbHiragana vbUnicode vbFromUnicodeSystem Color 常数: vbScrollBars vbDesktop vbActiveTitleBarvbInactiveTitleBar vbMenuBar vbWindowBackgroundvbWindowFrame vbMenuText vbWindowText vbTitleBarText vbActiveBorder vbInactiveBorder vbApplicationWorkspace vbHighlight vbHighlightText vbButtonFace vbButtonShadow vbGrayText vbButtonText vbInactiveCaptionTextvb3Dhighlight vb3DDKShadow vb3Dlight vbInfoTextvbInfoBackground三态常数: TristateTrue TristateFalse TristateUseDefaultVarType 常数: vbEmpty vbNull vbInteger vbLong vbSingle vbDouble vbCurrency vbDate vbString vbObject vbError vbBoolean vbVariant vbDataObject vbDecimal vbBytevbUserDefinedType vbArrayBoolean 数据类型 Byte 数据类型 Currency 数据类型 Date 数据类型Decimal 数据类型 Double 数据类型 Integer 数据类型 Long 数据类型Object 数据类型 Single 数据类型 String 数据类型用户定义数据类型Variant 数据类型#Const 指令 #If...Then...#Else 指令 Abs(number) Array(arglist) Asc(string) Atn(number) CallByName(object, procedurename, calltype,[arguments()])Choose(index, choice-1[, choice-2, ... [, choice-n]]) Chr(charcode) CommandCos(number) CreateObject(class,[servername]) CurDir[(drive)]CVErr(errornumber) Date DateAdd(interval, number, date)DateDiff(interval, date1, date2[, firstdayofweek[,firstweekofyear]])DatePart(interval,date[,firstdayofweek[,firstweekofyear]])DateSerial(year, month, day) DateValue(date) Day(date)DDB(cost,salvage, life, period[, factor]) Dir[(pathname[, attributes])]DoEvents( ) Environ({envstring| number}) EOF(filenumber) Error[(errornumber)] Exp(number) FileAttr(filenumber, returntype) FileDateTime(pathname)FileLen(pathname) Filter(InputStrings,Value[,Include[,Compare]])Format(expression[, format[, firstdayofweek[, firstweekofyear]]]) FormatCurrency(Expression[,NumDigitsAfterDecimal [,IncludeLeadingDigit[,UseParensForNegativeNumbers [,GroupDigits]]]])FormatDateTime(Date[,NamedFormat])FormatPercent(Expression[,NumDigitsAfterDecimal [,IncludeLeadingDigit[,UseParensForNegativeNumbers [,GroupDigits]]]])FreeFile[(rangenumber)] FV(rate, nper, pmt[, pv[, type]])GetAllSettings(appname,section) GetAttr(pathname)GetObject([pathname] [, class]) GetSetting(appname,section,key[,default])Hex(number) Hour(time) IIf(expr,truepart,falsepart) IMEStatusInput(number, [#]filenumber)InputBox(prompt[, title] [, default] [, xpos] [, ypos] [, helpfile, context]) InStr([start, ]string1, string2[, compare])InstrRev(string1,string2[,start[,compare]])Int(number) Fix(number) IPmt(rate, per, nper, pv[, fv[, type]])IRR(values()[, guess]) IsArray(varname) IsDate(expression)IsEmpty(expression) IsError(expression) IsMissing(argname)IsNull(expression) IsNumeric(expression) IsObject(identifier)Join(list[, delimiter]) LBound(arrayname[, dimension]) LCase(string)Left(string, length) Len(string | varname) Loc(filenumber) LOF(filenumber)Log(number) LTrim(string) RTrim(string) Trim(string)Mid(string, start[, length]) Minute(time)MIRR(values(),finance_rate, reinvest_rate) Month(date)MonthName(month[,abbreviate])MsgBox(prompt[, buttons] [, title] [, helpfile, context])Now NPer(rate, pmt, pv[, fv[, type]]) NPV(rate, values()) Oct(number) Partition(number, start, stop, interval) Pmt(rate, nper, pv[, fv[, type]])PPmt(rate, per, nper, pv[, fv[, type]]) PV(rate, nper, pmt[, fv[, type]]) QBColor(color) Rate(nper, pmt, pv[, fv[, type[, guess]]])Replace(expression,find,replacewith[,start[,count[,compare]]])RGB(red, green, blue) Right(string, length) Rnd[(number)]Round(expression [,numdecimalplaces]) Second(time) Seek(filenumber)Sgn(number) Shell(pathname[,windowstyle]) Sin(number)SLN(cost, salvage, life) Space(number) Spc(n)Split(expression[,delimiter[,count[,compare]]])Sqr(number) Str(number) StrComp(string1, string2[, compare])StrConv(string, conversion, LCID) StrReverse(string1)String(number, character)Switch(expr-1,value-1[,expr-2,value-2 _ [,expr-n,value-n]])SYD(cost, salvage, life, period) Tab[(n)] Tan(number) TimeTimer TimeSerial(hour,minute,second) TimeValue(time)CBool(expression)CByte(expression) CCur(expression)CDate(expression)CDbl(expression)CDec(expression)CInt(expression)CLng(expression)CSng(expression)CStr(expression)CVar(expression)CStr(expression) TypeName(varname) UBound(arrayname[, dimension]) UCase(string)VarType(varname) Weekday(date, [firstdayofweek])WeekdayName(weekday,abbreviate,firstdayofweek) Year(date)数据类型概述: Byte Boolean Integer Long Single Double CurrencyDecimal Date Object String String Variant VariantType导出的数学函数: Secant Cosecant Cotangent Inverse SineInverse Cosine Inverse Secant Inverse CosecantInverse Cotangent Hyperbolic Sine Hyperbolic CosineHyperbolic Tangent Hyperbolic SecantHyperbolic Cosecant Hyperbolic CotangentInverse Hyperbolic Sine Inverse Hyperbolic Cosinenverse Hyperbolic Tangent Inverse Hyperbolic SecantInverse Hyperbolic Cosecant nverse Hyperbolic Cotangent 逻辑运算符: And Eqv Imp Not Or Xor数学函数: Abs Atn Cos Exp Fix Int Log Rnd Sgn Sin Sqr Sqr运算符优先顺序: ^ - (*、/) \Mod (+、-) &= <> < > <= >= LikeNot And Or Xor Eqv Imp Is数组关键字总结: IsArrayArrayOption BaseDim, Private, Public, ReDim, StaticLBound, UboundErase, ReDimCollection 对象关键字总结: IsArrayArrayOption BaseDim, Private, Public, ReDim, StaticLBound, UboundErase, ReDim编译命令关键字总结: #Const#If...Then...#Else控制流关键字总结: GoSub...Return, GoTo, On Error, On...GoSub, On...GoTo DoEvents, End, Exit, StopDo...Loop For...Next, For Each...Next, While...Wend, With Choose, If...Then...Else, Select Case, SwitchCall, Function, Property Get, Property Let, Property Set, Sub 变换关键字总结: Chr Format, LCase, UCase DateSerial, DateValue Hex, Oct Format, StrCBool, CByte, CCur, CDate, CDbl, CDec, CInt, CLng, CSng,CStr, CVar, CVErr, Fix, IntDay, Month, Weekday, YearHour, Minute, Second Asc ValTimeSerial, TimeValue数据类型关键字总结: CBool, CByte, CCur, CDate, CDbl, CDec, CInt, CLng,CSng, CStr, CVar, CVErr, Fix, IntBoolean, Byte, Currency, Date, Double, Integer, Long, Obect, Single,String, Variant (default)IsArray, IsDate, IsEmpty, IsError, IsMissing, IsNull,IsNumeric, IsObject日期与时间关键字总: Date ,Now, Time DateAdd, DateDiff, DatePartDateSerial, DateValue TimeSerial, TimeValueDate, Time Timer目录和文件关键字总结: ChDir ChDrive FileCopy MkDirRmDir Name CurDir FileDateTimeGetAttr FileLen Dir SetAttr错误关键字总结: Clear, Error, Raise Error Err CVErrOn Error, Resume IsError金融关键字总结: DDB, SLN, SYD FV Rate IRR, MIRRNPer IPmt, Pmt, PPmt NPV, PV输入与输出关键字总结: DDB, SLN, SYD FV Rate IRR,MIRR NPer IPmt, Pmt, PPmt NPV, PV 数学关键字总结: Atn, Cos, Sin, Tan Exp, Log, Sqr Randomize, RndAbs Sgn Fix, Int其他关键字总结: DoEvents AppActivate, Shell SendKeysBeep Environ Command MacID, MacScriptCreateObject, GetObject QBColor, RGB运算符关键字总结: DoEvents AppActivate, Shell SendKeysBeep Environ Command MacID, MacScriptCreateObject, GetObject QBColor, RGB注册关键字总结: DoEvents AppActivate, Shell SendKeysBeep Environ Command MacID, MacScriptCreateObject, GetObject QBColor, RGB字符串处理关键字总结: StrComp StrConv Format, LCase, UCaseSpace, String Len Format LSet, RSetInStr, Left, LTrim, Mid, Right, RTrim, TrimOption Compare Asc, Chr变量与常数关键字总结: Let Const, Dim, Private, Public, New, StaticOption Private ModuleIsArray, IsDate, IsEmpty, IsError, IsMissing, IsNull,IsNumeric, IsObject, TypeName, VarTypeMe Option Explicit DeftypeAs: Const 语句 Declare 语句 Dim 语句 Function 语句 Name 语句Open 语句 Private 语句 Property Get 语句 Property Let 语句Property Set 语句 Public 语句 ReDim 语句 Static 语句Sub 语句 Type 语句Binary: Open 语句 Option Compare 语句ByRef: Call 语句 Declare 语句 Function 语句 Property Get 语句Property Let 语句 Property Set 语句 Sub 语句ByVal: Call 语句 Declare 语句 Function 语句 Property Get 语句Property Let 语句 Property Set 语句 Sub 语句Date: Date 数据类型 Date 函数 Date 语句Else: If...Then...Else 语句 Select Case 语句Empty: Empty关键字是用作 Variant 子类型。

vba 常数表达式

vba 常数表达式

vba 常数表达式
VBA常数表达式是指在编写VBA代码时,用于表示固定值的表达式。

这些表达式的值在编写代码期间就已经确定,并且不会在代码执行期间发生改变。

常见的VBA常数表达式包括:
1. 数字常量:如整数、浮点数、科学计数法等。

2. 字符串常量:用单引号或双引号括起来的文本。

3. 逻辑常量:True和False。

4. 特殊常量:如vbNull、vbCr、vbLf等。

使用常数表达式可以使代码更加简洁、易于维护和调试。

在编写代码时,应尽量避免使用字面量和硬编码的数值,而应该使用常数表达式来表示这些值。

这样可以减少代码中的重复代码、减少出错的可能性,并且更加方便进行修改。

例如,在编写一个计算圆周长的VBA程序时,可以使用常数表达式来表示圆周率(π),如下所示:
Const Pi As Double = 3.1415926
Sub CalculateCircumference()
Dim r As Double
Dim c As Double
r = InputBox('请输入圆的半径:')
c = 2 * Pi * r
MsgBox '圆的周长为:' & c
End Sub
在上述代码中,我们使用了一个常数表达式来表示圆周率,而不是直接使用3.1415926这个字面量。

这样可以使代码更加易读、易于修改,并且在将来如果需要修改圆周率的值时,只需要修改一处常数表达式即可。

keycode

keycode

KeyAscii是键盘输入后传递给程序的ASCII码,关于ASCII码,各种电脑书籍一般都有附录,网络上搜索也很多。

常规ASCII码是0~127,一般可以显示的是32~127关于KeyAscii的使用,主要是拦截判断键盘输入的键值,比如,只允许输入数字,就可以在文本框的KeyPress中输入:If KeyAscii < 48 Or KeyAscii > 57 Then KeyAscii = 0;(keyAscii=0表示:取消本次输入的字符)KeyAscii键码常数值描述vbKeyLButton 1 鼠标左键vbKeyRButton 2 鼠标右键vbKeyCancel 3 CANCEL 键vbKeyMButton 4 鼠标中键vbKeyBack 8 BACKSPACE 键vbKeyTab 9 TAB 键vbKeyClear 12 CLEAR 键vbKeyReturn 13 ENTER 键vbKeyShift 16 SHIFT 键vbKeyControl 17 CTRL 键vbKeyMenu 18 菜单键vbKeyPause 19 PAUSE 键vbKeyCapital 20 CAPS LOCK 键vbKeyEscape 27 ESC 键vbKeySpace 32 SPACEBAR 键vbKeyPageUp 33 PAGEUP 键vbKeyPageDown 34 PAGEDOWN 键vbKeyEnd 35 END 键vbKeyHome 36 HOME 键vbKeyLeft 37 LEFT ARROW 键vbKeyUp 38 UP ARROW 键vbKeyRight 39 RIGHT ARROW 键vbKeyDown 40 DOWN ARROW 键vbKeySelect 41 SELECT 键vbKeyPrint 42 PRINT SCREEN 键vbKeyExecute 43 EXECUTE 键vbKeySnapshot 44 SNAP SHOT 键vbKeyInser 45 INS 键vbKeyDelete 46 DEL 键vbKeyHelp 47 HELP 键vbKeyNumlock 144 NUM LOCK 键A 键到Z 键与其ASCII 码的相应值'A' 到'Z' 是一致的常数值描述vbKeyA 65 A 键vbKeyB 66 B 键vbKeyC 67 C 键vbKeyD 68 D 键vbKeyE 69 E 键vbKeyF 70 F 键vbKeyG 71 G 键vbKeyH 72 H 键vbKeyI 73 I 键vbKeyJ 74 J 键vbKeyK 75 K 键vbKeyL 76 L 键vbKeyM 77 M 键vbKeyN 78 N 键vbKeyO 79 O 键vbKeyP 80 P 键vbKeyQ 81 Q 键vbKeyR 82 R 键vbKeyS 83 S 键vbKeyT 84 T 键vbKeyU 85 U 键vbKeyV 86 V 键vbKeyW 87 W 键vbKeyX 88 X 键vbKeyY 89 Y 键vbKeyZ 90 Z 键0 键到9 键与其ASCII 码的相应值'0' 到'9' 是一致的常数值描述vbKey0 48 0 键vbKey1 49 1 键vbKey2 50 2 键vbKey3 51 3 键vbKey4 52 4 键vbKey5 53 5 键vbKey6 54 6 键vbKey7 55 7 键vbKey8 56 8 键vbKey9 57 9 键数字小键盘上的键常数值描述vbKeyNumpad0 96 0 键vbKeyNumpad1 97 1 键vbKeyNumpad2 98 2 键vbKeyNumpad3 99 3 键vbKeyNumpad4 100 4 键vbKeyNumpad5 101 5 键vbKeyNumpad6 102 6 键vbKeyNumpad7 103 7 键vbKeyNumpad8 104 8 键vbKeyNumpad9 105 9 键vbKeyMultiply 106 乘号(*) 键vbKeyAdd 107 加号(+) 键vbKeySeparator 108 ENTER 键(在数字小键盘上)vbKeySubtract 109 减号(-) 键vbKeyDecimal 110 小数点(.) 键vbKeyDivide 111 除号(/) 键功能键常数值描述vbKeyF1 112 F1 键vbKeyF2 113 F2 键vbKeyF3 114 F3 键vbKeyF4 115 F4 键vbKeyF5 116 F5 键vbKeyF6 117 F6 键vbKeyF7 118 F7 键vbKeyF8 119 F8 键vbKeyF9 120 F9 键vbKeyF10 121 F10 键vbKeyF11 122 F11 键vbKeyF12 123 F12 键vbKeyF13 124 F13 键vbKeyF14 125 F14 键vbKeyF15 126 F15 键vbKeyF16 127 F16 键。

VB中常用函数及有用的KeyAscii键码

VB中常用函数及有用的KeyAscii键码

VB中常用函数及有用的KeyAscii键码常用函数1.VAL()函数1.功能返回由数字组成的字符表达式的数字值.2.语法结构VAL(cExpression)其中,字符表达式最多由16位数字组成,若超过16位,则对其圆整.3.举例STORE'12'TO ASTORE'13'TO B?VAL(A)+VAL(B) 显示25.00★补充说明VAL()就是函数用于将数值字符串转换为数值。

即:将字符型(C)的数字符号转换为数值型(N)的数字符号.?VAL("1.234") &&结果为 1.23?VAL("A1.256") &&结果为0.00?VAL("1A.234") &&结果为 1.00但如果字符串内出现非字符型数据,那么只转换前面部分;如果字符串的首字符不是数字符号,则返回数值0,但忽略前导空格。

1.CStr()函数转化一个表达式为字符串.表达式CStr(expression)允许数据类型: expression 是任何有效的表达式。

实例:<%s = 3 + 2response.write "The 返回结果is: " & cStr(s)%>返回结果: 转化数字“5”为字符“5”。

2.VB使用Str()与CStr()的区别两个函数都是可以把数值转换成字符串不相同的是Str()返回的值是以String类型表示的数值(带符号位)Str转换后的字符串前后都带空格Str转换的原类型只能是数值CStr()除了可以转换数值类型还可以转换其他的类型如Boolean,Error类型等3.VB中的数据类型a)数据类型概述数据:计算机能够处理数值、文字、声音、图形、图像等信息,均称为数据。

数据类型:根据数据描述信息的含义,将数据分为不同的种类,对数据种类的区分规定,称为数据类型。

VB的keycode和keyascii大全及应用

VB的keycode和keyascii大全及应用

VB的keycode和keyascii⼤全及应⽤VB的keycode和keyascii⼤全及应⽤Vb的keycode和keyasciiVB KeyCode 常数表常数值描述常数值描述vbKeyLButton 0x1 ⿏标左键vbKeyT 84 T 键vbKeyRButton 0x2 ⿏标右键vbKeyU 85 U 键vbKeyCancel 0x3 CANCEL 键vbKeyV 86 V 键vbKeyMButton 0x4 ⿏标中键vbKeyW 87 W 键vbKeyBack 0x8 BACKSPACE 键vbKeyX 88 X 键vbKeyTab 0x9 TAB 键vbKeyY 89 Y 键vbKeyClear 0xC CLEAR 键vbKeyZ 90 Z 键vbKeyReturn 0xD ENTER 键vbKeyShift 0x10 SHIFT 键vbKey0 48 0 键vbKeyControl 0x11 CTRL 键vbKey1 49 1 键vbKeyMenu 0x12 MENU 键vbKey2 50 2 键vbKeyPause 0x13 PAUSE 键vbKey3 51 3 键vbKeyCapital 0x14 CAPS LOCK 键vbKey4 52 4 键vbKeyEscape 0x1B ESC 键vbKey5 53 5 键vbKeySpace 0x20 SPACEBAR 键vbKey6 54 6 键vbKeyPageUp 0x21 PAGE UP 键vbKey7 55 7 键vbKeyEnd 0x23 END 键vbKey8 56 8 键vbKeyHome 0x24 HOME 键vbKey9 57 9 键vbKeyLeft 0x25 LEFT ARROW 键vbKeyUp 0x26 UP ARROW 键vbKeyRight 0x27 RIGHT ARROW 键vbKeyNumpad0 0x60 0 键vbKeyDown 0x28 DOWN ARROW 键vbKeyNumpad1 0x61 1 键vbKeySelect 0x29 SELECT 键vbKeyNumpad2 0x62 2 键vbKeyPrint 0x2A PRINT SCREEN 键vbKeyNumpad3 0x63 3键vbKeyExecute 0x2B EXECUTE 键vbKeyNumpad4 0x64 4 键vbKeySnapshot 0x2C SNAPSHOT 键vbKeyNumpad5 0x65 5 键vbKeyDelete 0x2E DELETE 键vbKeyNumpad6 0x66 6 键vbKeyHelp 0x2F HELP 键vbKeyNumpad7 0x67 7 键vbKeyNumlock 0x90 NUM LOCK 键vbKeyNumpad8 0x68 8 键vbKeyNumpad9 0x69 9 键vbKeyA 65 A 键vbKeyMultiply 0x6A MULTIPLICATIONSIGN(*) vbKeyB 66 B 键vbKeyAdd 0x6B PLUS SIGN (+) 键vbKeyC 67 C 键vbKeySeparator 0x6C ENTER 键vbKeyD 68 D 键vbKeySubtract 0x6D MINUS SIGN (-) 键vbKeyE 69 E 键vbKeyDecimal 0x6E DECIMAL POINT (.) 键vbKeyF 70 F 键vbKeyDivide 0x6F DIVISION SIGN (/) 键vbKeyG 71 G 键vbKeyH 72 H 键vbKeyF1 0x70 F1 键vbKeyI 73 I 键vbKeyF2 0x71 F2 键vbKeyJ 74 J 键vbKeyF3 0x72 F3 键vbKeyK 75 K 键vbKeyF4 0x73 F4 键vbKeyL 76 L 键vbKeyF5 0x74 F5 键vbKeyM 77 M 键vbKeyF6 0x75 F6 键vbKeyN 78 N 键vbKeyF7 0x76 F7 键vbKeyP 80 P 键vbKeyF9 0x78 F9 键vbKeyQ 81 Q 键vbKeyF10 0x79 F10 键vbKeyR 82 R 键vbKeyF11 0x7A F11 键vbKeyS 83 S 键vbKeyF12 0x7B F12 键Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)Me.ClsPrint Chr$(KeyCode); KeyCodeEnd SubPrivate Sub Form_KeyDown(KeyAscii As Integer, Shift As Integer)Me.ClsPrint Chr$(KeyAscii); KeyAsciiEnd SubASCII码对照表ASCII, American Standard Code for Information Interchange 念起來像是"阿斯key",定義從0 到127 的⼀百⼆⼗⼋個數字所代表的英⽂字母或數字或符號,所有使⽤ASCII 的電腦之間可以互相讀取同⼀份⽂件⽽不會有不⼀樣的結果與意義。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
vbKeyQ 81 Q 键
vbKeyR 82 R 键
vbKeyS 83 S 键
vbKeyT 84 T 键
vbKeyU 85 U 键
vbKeyV 86 V 键
vbKeyW 87 W 键
vbKeyX 88 X 键
vbKeyY 89 Y 键
vbKeyZ 90 Z 键
Keycode 常数
可在代码中的任何地方用下列常数代替实际值:
常数 值 描述
vbKeyLButton 0x1 鼠标左键
vbKeyRButton 0x2 鼠标右键
vbKeyCancel 0x3 CANCEL 键
vbKeyMButton 0x4 鼠标中键
vbKeyBack 9 键与数字 0 – 9 的 ASCII 码相同:
常数 值 描述
vbKey0 48 0 键
vbKey1 49 1 键
vbKey2 50 2 键
vbKey3 51 3 键
vbKey4 52 4 键
vbKey5 53 5 键
vbKey6 54 6 键
vbKey7 55 7 键
vbKeyHome 0x24 HOME 键
vbKeyLeft 0x25 LEFT ARROW 键
vbKeyUp 0x26 UP ARROW 键
vbKeyRight 0x27 RIGHT ARROW 键
vbKeyDown 0x28 DOWN ARROW 键
vbKeySelect 0x29 SELECT 键
vbKeyPrint 0x2A PRINT SCREEN 键
vbKeyExecute 0x2B EXECUTE 键
vbKeySnapshot 0x2C SNAPSHOT 键
vbKeyInsert 0x2D INSERT 键
vbKeyDelete 0x2E DELETE 键
vbKeyHelp 0x2F HELP 键
vbKeyF8 0x77 F8 键
vbKeyF9 0x78 F9 键
vbKeyF10 0x79 F10 键
vbKeyF11 0x7A F11 键
vbKeyF12 0x7B F12 键
vbKeyF13 0x7C F13 键
vbKeyF14 0x7D F14 键
vbKeyF15 0x7E F15 键
vbKeyCapital 0x14 CAPS LOCK 键
vbKeyEscape 0x1B ESC 键
vbKeySpace 0x20 SPACEBAR 键
vbKeyPageUp 0x21 PAGE UP 键
vbKeyPageDown 0x22 PAGE DOWN 键
vbKeyEnd 0x23 END 键
vbKeyG 71 G 键
vbKeyH 72 H 键
vbKeyI 73 I 键
vbKeyJ 74 J 键
vbKeyK 75 K 键
vbKeyL 76 L 键
vbKeyM 77 M 键
vbKeyN 78 N 键
vbKeyO 79 O 键
vbKeyP 80 P 键
vbKeyAdd 0x6B PLUS SIGN (+) 键
vbKeySeparator 0x6C ENTER 键
vbKeySubtract 0x6D MINUS SIGN (–) 键
vbKeyDecimal 0x6E DECIMAL POINT (.) 键
vbKeyDivide 0x6F DIVISION SIGN (/) 键
vbKey8 56 8 键
vbKey9 57 9 键
下列常数代表数字键盘上的键:
常数 值 描述
vbKeyNumpad0 0x60 0 键
vbKeyNumpad1 0x61 1 键
vbKeyNumpad2 0x62 2 键
vbKeyNumpad3 0x63 3 键
vbKeyNumpad4 0x64 4 键
vbKeyF16 0x7F F16 键

vbKeyTab 0x9 TAB 键
vbKeyClear 0xC CLEAR 键
vbKeyReturn 0xD ENTER 键
vbKeyShift 0x10 SHIFT 键
vbKeyControl 0x11 CTRL 键
vbKeyMenu 0x12 MENU 键
vbKeyPause 0x13 PAUSE 键
vbKeyNumlock 0x90 NUM LOCK 键
A 至 Z 键与 A – Z 字母的 ASCII 码相同:
常数 值 描述
vbKeyA 65 A 键
vbKeyB 66 B 键
vbKeyC 67 C 键
vbKeyD 68 D 键
vbKeyE 69 E 键
vbKeyF 70 F 键
下列常数代表功能键:
常数 值 描述
vbKeyF1 0x70 F1 键
vbKeyF2 0x71 F2 键
vbKeyF3 0x72 F3 键
vbKeyF4 0x73 F4 键
vbKeyF5 0x74 F5 键
vbKeyF6 0x75 F6 键
vbKeyF7 0x76 F7 键
vbKeyNumpad5 0x65 5 键
vbKeyNumpad6 0x66 6 键
vbKeyNumpad7 0x67 7 键
vbKeyNumpad8 0x68 8 键
vbKeyNumpad9 0x69 9 键
vbKeyMultiply 0x6A MULTIPLICATION SIGN (*) 键
相关文档
最新文档