有谁知道怎么用VB限制键盘输入啊
比如:使按下windows徽标键不起作用 (也就是不让开始菜单弹出)
另外其它组合键也要禁用。应该怎么做?
[此贴子已经被作者于2006-4-1 13:50:57编辑过]
具体的键码,请查看相应的代号...
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
Dim keyascii As Integer = Asc(e.KeyChar)
Select Case keyascii
Case Is < 32
...
Case 65 To 90
...
Case 97 To 122
...
Case Else
keyascii = 0
MessageBox.Show("登陆名,只能是英文字符!--谢谢合作!", "人事管理系统--信息提示!", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Select
End Sub
Dim keyascii As Integer = Asc(e.KeyChar)
Select Case keyascii
Case 13
MsgBox("你已按下了Enter键!")
Case 33
Msgbox("你已按下了" & keyascii.tostring() & "键")
Case 55
...
Case Else
keyascii = 0
MessageBox.Show("others!", "Informations!", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Select
If keyascii = 0 Then
e.Handled = True
TextBox1.Text = ""
TextBox1.Focus()
End If