思路:
成都创新互联公司服务项目包括遵义网站建设、遵义网站制作、遵义网页制作以及遵义网络营销策划等。多年来,我们专注于互联网行业,利用自身积累的技术优势、行业经验、深度合作伙伴关系等,向广大中小型企业、政府机构等提供互联网行业的解决方案,遵义网站推广取得了明显的社会效益与经济效益。目前,我们服务的客户以成都为中心已经辐射到遵义省份的部分城市,未来相信会继续扩大服务区域并继续获得客户的支持与信任!
假设在软键盘上建立26个字母键;姿唯悔
单击相应的键时模拟按键或直接输出到目标;
模拟按键时可行的,直接输出必须获得句柄才行,具体分析;
给你提供模拟按键代码迹正:
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal Scan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Sub Timer1_Timer()
Call keybd_event(82, 0, 0, 0) '模拟按下"R"键
End Sub
码值对应表:
A 至 Z 键与 A – Z 字母的 ASCII 码相同:
值 描述
65 A 键
66 B 键
67 C 键
68 D 键
69 E 键
70 F 键
71 G 键
72 H 键
73 I 键
74 J 键
75 K 键
76 L 键
77 M 键
78 N 键
79 O 键
80 P 键
81 Q 键
82 R 键
83 S 键
84 T 键
85 U 键
86 V 键
87 W 键
88 X 键
89 Y 键
90 Z 键
0 至 9 键与数山答字 0 – 9 的 ASCII 码相同:
值 描述
48 0 键
49 1 键
50 2 键
51 3 键
52 4 键
53 5 键
54 6 键
55 7 键
56 8 键
57 9 键
下列常数代表数字键盘上的键:
值 描述
0x60 0 键
0x61 1 键
0x62 2 键
0x63 3 键
0x64 4 键
0x65 5 键
0x66 6 键
0x67 7 键
0x68 8 键
0x69 9 键
0x6A MULTIPLICATION SIGN (*) 键
0x6B PLUS SIGN (+) 键
0x6C ENTER 键
0x6D MINUS SIGN (–) 键
0x6E DECIMAL POINT (.) 键
0x6F DIVISION SIGN (/) 键
下列常数代表功能键:
值 描述
0x70 F1 键
0x71 F2 键
0x72 F3 键
0x73 F4 键
0x74 F5 键
0x75 F6 键
0x76 F7 键
0x77 F8 键
0x78 F9 键
0x79 F10 键
0x7A F11 键
0x7B F12 键
0x7C F13 键
0x7D F14 键
0x7E F15 键
0x7F F16 键
0 None
3 Cancel(Break)
8 Back
9 Tab
13 Return
16 ShiftKey
17 ControlKey
18 Menu
19 Pause
20 Capital(大小写)
27 Escape
32 Space
33 PageUp
34 Next(PageDonw)
35 End
36 Home
37 Left
38 Up
39 Right
40 Down
0-9 48-57
45 Insert
46 Delete
65-90 A-Z
91 LWin
93 Apps
96 105 NumPad0-
106 Multiply *
107 Add+
108
109 Subtract-
110 Decimal .
111 Divide /
112-123 F1-F12
既然你可以输入英文,只要系统切换到中文输入方式下,例如“谷歌拼音”,不就可以输入中文了
Public Class Form2
Private Sub Form2_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
AddHandler Label1.MouseEnter, AddressOf LabelMouseEnter
AddHandler Label2.MouseEnter, AddressOf LabelMouseEnter
AddHandler Label1.MouseLeave, AddressOf LabelMouseLeave
AddHandler Label2.MouseLeave, AddressOf LabelMouseLeave
AddHandler Label1.MouseDown, AddressOf LabelMouseDown
AddHandler Label2.MouseDown, AddressOf LabelMouseDown
End Sub
Private Sub LabelMouseEnter(ByVal sender As Object, ByVal e As System.EventArgs)
Dim c As Label = DirectCast(sender, Label)
c.BackColor = Color.DodgerBlue
End Sub
Private Sub LabelMouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
Dim c As Label = DirectCast(sender, Label)
Form1.TextBox1.Text = c.Text
End Sub
Private Sub LabelMouseLeave(ByVal sender As Object, ByVal e As System.EventArgs)
Dim c As Label = DirectCast(sender, Label)
c.BackColor = SystemColors.Control
End Sub
End Class