indy500fan
asked on
Handle keydowns on a form with tab pages....
Friends,
I have a form with 2 TabPages and I want to be able to press the F keys. However, when I try and push F9 for example, the Handles MyBase.KeyDown is never reached.
What's going on?
Thanks in advance!
Best Regards,
Eric
I have a form with 2 TabPages and I want to be able to press the F keys. However, when I try and push F9 for example, the Handles MyBase.KeyDown is never reached.
What's going on?
Thanks in advance!
Best Regards,
Eric
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
'When the function keys are pressed, FuncKeysModule is called.
If e.KeyValue = Keys.F1 Or Keys.F2 Or Keys.F3 Or Keys.F4 Or Keys.F5 Or Keys.F6 Or Keys.F7 Or Keys.F8 Or Keys.F9 Or Keys.F10 Or Keys.F11 Or Keys.F12 Then
FuncKeysModule(e.KeyValue)
e.Handled = True
End If
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hawkvalley1,
Yep that worked!
JPaulino, I agree, and I have that part worked out, but the control went to the tabpages first and not the form, so I could never even test the conditions; which is the root of my question.
Thanks,
Eric
Yep that worked!
JPaulino, I agree, and I have that part worked out, but the control went to the tabpages first and not the form, so I could never even test the conditions; which is the root of my question.
Thanks,
Eric
ASKER
Exactly what I needed.
If e.KeyValue = Keys.F1 Or e.KeyValue = Keys.F2 Or e.KeyValue = Keys.F3 Or ...
Or use a Select Case statement:
Open in new window