189 8069 5689

vb.net键盘f1 vb ctrl+c

VB 编程 设F1~F12的快捷键

一楼的方法比较巧妙,不过楼上的好像不行

创新互联公司自2013年创立以来,是专业互联网技术服务公司,拥有项目成都网站制作、网站设计网站策划,项目实施与项目整合能力。我们以让每一个梦想脱颖而出为使命,1280元渭城做网站,已为上家服务,为渭城各地企业和个人服务,联系电话:028-86922220

最完善的方法当然做键盘勾子

简单点的,就在Form的KeyDown属性里做就OK了

也要把窗口的keypreview设为True,然后粘贴下面的代码:

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

if keycode=vbkeyf3 then check1.value=check1.value xor 1

End Sub

就一句

vb.net 怎么返回回车键、空格键、F1-F12这些键的ASCII值啊?

自己做个试验就行了:

Public Class Form1

' 在窗体上放个 Label1

Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown

Lable1.Text = "KeyCode= "  e.KeyCode.ToString  vbCrLf

Lable1.Text = "KeyData= "  e.KeyData.ToString  vbCrLf

Lable1.Text = "KeyValue= "  e.KeyValue.ToString

End Sub

End Class

运行起来,自己按键盘试试就知道了。

VB.net 软键盘 制作

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


标题名称:vb.net键盘f1 vb ctrl+c
浏览路径:http://cdxtjz.cn/article/hgdjsd.html

其他资讯