|
-
Jun 9th, 2002, 05:47 AM
#1
Thread Starter
Member
Using Functions keys F1 to F12
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
-
Jun 9th, 2002, 10:24 AM
#2
Addicted Member
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
That which does not kill us, only makes us stronger. 
-
Jun 9th, 2002, 10:31 AM
#3
Thread Starter
Member
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.
-
Jun 9th, 2002, 10:34 AM
#4
Addicted Member
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. ?
That which does not kill us, only makes us stronger. 
-
Jun 9th, 2002, 10:43 AM
#5
Thread Starter
Member
I'll explore that approach, thnx
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|