Close form with Esc key

  • Thread starter Thread starter Mota331
  • Start date Start date
M

Mota331

Guest
Using VB.NET and can't figure out how to make it that when the use presses the ESC key it closes the form. Like an About Box
 
i've never used vb net but if its like 6.0 in sub_keydown of the form you can type
Private Sub Key_Down(Keycode as integer,shift as integer)
if keycode = vbkeyescape then
unload me
end if
 
Yeah thats what I thought but it doesn't work. They changed a lot for instance Unload Me doesn't even work, why they changed it I don't know. Its like a whole new language.
 
Got it once again. Had to make a Command Button and link that button to the CancelButton property on the form. It does the rest.

Thanks for the response
 
Back
Top