思路:
成都創(chuàng)新互聯(lián)公司服務(wù)項目包括遵義網(wǎng)站建設(shè)、遵義網(wǎng)站制作、遵義網(wǎng)頁制作以及遵義網(wǎng)絡(luò)營銷策劃等。多年來,我們專注于互聯(lián)網(wǎng)行業(yè),利用自身積累的技術(shù)優(yōu)勢、行業(yè)經(jīng)驗、深度合作伙伴關(guān)系等,向廣大中小型企業(yè)、政府機構(gòu)等提供互聯(lián)網(wǎng)行業(yè)的解決方案,遵義網(wǎng)站推廣取得了明顯的社會效益與經(jīng)濟效益。目前,我們服務(wù)的客戶以成都為中心已經(jīng)輻射到遵義省份的部分城市,未來相信會繼續(xù)擴大服務(wù)區(qū)域并繼續(xù)獲得客戶的支持與信任!
假設(shè)在軟鍵盤上建立26個字母鍵;姿唯悔
單擊相應(yīng)的鍵時模擬按鍵或直接輸出到目標(biāo);
模擬按鍵時可行的,直接輸出必須獲得句柄才行,具體分析;
給你提供模擬按鍵代碼跡正:
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
碼值對應(yīng)表:
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 鍵與數(shù)山答字 0 – 9 的 ASCII 碼相同:
值 描述
48 0 鍵
49 1 鍵
50 2 鍵
51 3 鍵
52 4 鍵
53 5 鍵
54 6 鍵
55 7 鍵
56 8 鍵
57 9 鍵
下列常數(shù)代表數(shù)字鍵盤上的鍵:
值 描述
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 (/) 鍵
下列常數(shù)代表功能鍵:
值 描述
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
既然你可以輸入英文,只要系統(tǒng)切換到中文輸入方式下,例如“谷歌拼音”,不就可以輸入中文了
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