Capturing key

  • Thread starter Thread starter John
  • Start date Start date
Hi,


Set the form keypreview to true if you want to catch esc no matter
what control has the focus.

Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown

If e.KeyCode = Keys.Escape Then

MessageBox.Show("Escape")

End If

End Sub



Ken
 
Back
Top