how can I stop the input of the keyboard for a user
I want that everytime the user press a key the program read what key was and only accept some keys that I want
Printable View
how can I stop the input of the keyboard for a user
I want that everytime the user press a key the program read what key was and only accept some keys that I want
vb.net Code:
Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As KeyEventArgs) Handles TextBox1.KeyDown If Not e.KeyCode = Keys.A Then 'A is an accepted key e.Handled = True End If End Sub
that should work
It didn't work but I found a solution
Code:Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
If Not e.KeyCode = Keys.A Then 'A is an accepted key
e.SuppressKeyPress = True
End If
End Sub
That was what I meant:P
Glad you found it:D