Does anyone know what setting you change to be able to push the ESC key and the window will close? Thanks!
Brenda
Printable View
Does anyone know what setting you change to be able to push the ESC key and the window will close? Thanks!
Brenda
Well if you have close (or cancel) button on the form then all you have to do is go to your Form property and set CancelButton option to your Close button.
:D
this mate?
first set the form.keypreview property to true. if this doesn't help, i'm sorry.VB Code:
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown If e.KeyCode = Keys.Escape Then Close() End If End Sub
Niether of those work. Or maybe I am just doing it wrong. Any other suggestions?
It work’s on my system. I attached example file.
:thumb: