KeyStorke
-
I cant seem to remember how to record keystrokes. Basically i need to use the keystroke value in an IF Statement to say, if back or delete were pressed then end if thanks in advance Karma
-
I cant seem to remember how to record keystrokes. Basically i need to use the keystroke value in an IF Statement to say, if back or delete were pressed then end if thanks in advance Karma
The windows form as a KeyPress event that you can look at to retrieve the keystroke.
CleAkO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that." - Tommy Boy
"Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School) -
I cant seem to remember how to record keystrokes. Basically i need to use the keystroke value in an IF Statement to say, if back or delete were pressed then end if thanks in advance Karma
Here is some code that should work for you... Private Sub yourtextbox_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles yourtextbox.KeyDown 'Only allow some control keys If e.KeyValue = Keys.Delete OrElse e.KeyValue = Keys.Back Then 'good key press Else e.Handled = True End If End Sub Hope that helps. Ben
-
I cant seem to remember how to record keystrokes. Basically i need to use the keystroke value in an IF Statement to say, if back or delete were pressed then end if thanks in advance Karma
use the key down event handler as below Private Sub txtTendered_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtTendered.KeyDown If e.KeyCode = Keys.delete Then do something here elseif e.keycode = keys.enter then do something else end if end sub hope this helps
Nab