This is easy one...

DR00ME

Well-known member
Joined
Feb 6, 2004
Messages
169
Location
Finland
How do I bind a keyboard key(s) to a button ? Like if I press F1 some button in the form is pressed.... I know there is a event for it but dont know which one and how to insert keys in it.

Allrite...
 
Last edited by a moderator:
Thats actually a very long one :)

But to point you in the right direction, use KeyDown, KeyPress or KeyUp. There should be plenty of examples about, on exactly how to use them as this is a common question.
 
Well if you call this a long one :)

Code:
  If e.KeyCode = Keys.F1 Then
                btnStop.PerformClick()
            End If

edited: now it is even shorter without .ToString!
 
Last edited by a moderator:
Back
Top