Reputation: 1830
just now I was trying to capture the F1 key on the form, but only managed when the form is selected, and I need to detect it in any form control
I used this code:
Select Case e.KeyCode
Case Keys.F1
MsgBox("Right")
e.Handled = True
End Select
Upvotes: 0
Views: 309
Reputation: 94653
You need to set Form.KeyPreview=True - If it is true then form will receive all key events.
Upvotes: 2