Set the form's 'KeyPreview' property to 'True', then add this code to your
form (assuming the form's class name is 'Form1'):
\\\
Private Sub Form1_KeyDown( _
ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyEventArgs _
) Handles MyBase.KeyDown
If e.KeyCode = Keys.F2 Then
MsgBox("F2 pressed!")
End If
End Sub
///
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.