建議你這樣試試看:
創(chuàng)新互聯(lián)建站自2013年起,是專業(yè)互聯(lián)網(wǎng)技術服務公司,擁有項目成都網(wǎng)站建設、網(wǎng)站制作網(wǎng)站策劃,項目實施與項目整合能力。我們以讓每一個夢想脫穎而出為使命,1280元深州做網(wǎng)站,已為上家服務,為深州各地企業(yè)和個人服務,聯(lián)系電話:028-86922220
做一個下拉框,里邊是所有客戶可能用到的快捷鍵集合
當按下按鈕時,獲取下拉框的按鍵名稱,再將字符串轉換Keys枚舉,然后進行判斷
既然你可以輸入英文,只要系統(tǒng)切換到中文輸入方式下,例如“谷歌拼音”,不就可以輸入中文了
(1)在Form1上布置一個Label,用來顯示鍵盤碼
(2)窗體代碼如下
Imports?System.Windows.Forms
Imports?System.IO
Imports?System.Net
Imports?System.Windows.Forms
Imports?System.IO
Imports?System.Net
Public?Class?Form1
Private?Sub?Form1_Load(sender?As?Object,
e?As?EventArgs)?Handles?MyBase.Load
KeyPreview?=?True
End?Sub
Private?Sub?Form1_KeyDown(sender?As?Object,
e?As?KeyEventArgs)?Handles?MyBase.KeyDown
Label1.Text?=?e.KeyValue
End?Sub
End?Class
按鍵盤上的鍵,Label1將顯示對應鍵的鍵盤碼
.net框架就是對API就行封裝,做成一個個的類然后可以讓你輕松調用,但是。net封裝的內容,是常用的內容,有些東西用的時候,還是需要調用API函數(shù),自己寫,畢竟,微軟不知道你要用什么函數(shù),所以盡可能的滿足用戶大眾口味而已。如果你需要用的比較復雜,還是調用API自己寫類吧。
希望我的回答對您有所幫助
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