Contact: aviboots(AT)netvision.net.il
39,859 questions
51,780 answers
573 users
' First set the KeyPreview property on the form to True, then write the code: Public Class Form1 Private Sub Form1_KeyDown(sender As Object, e As KeyEventArgs) Handles MyBase.KeyDown If e.KeyCode = Keys.Escape Then Me.Close() End Sub End Class