Can anyone tell me how I can 'see', in a VB form, whether the function-keys are pressed.
And how to launch a procedure at that moment?
Maybe some code please?
Thnx
Printable View
Can anyone tell me how I can 'see', in a VB form, whether the function-keys are pressed.
And how to launch a procedure at that moment?
Maybe some code please?
Thnx
Try this :)
Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
If e.KeyCode = Keys.F2 Then MsgBox("F2 Pressed")
End Sub
Thanx wolfofthenorth
but in your example I should place the code after every control of my form.
I would like to fire the event/procedure as soon the button is pressed. Can't I put the code after the KeyPressed-event from the form?
I hope you have the solution
Thnx
B.
I don't think some of the function keys will fire the KeyPress event. It looked like F keys will only fire the Key up and down events.
You might be able to have one event handle all of your controls. ?
I'll explore that approach, thnx