Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

close a form pressing "esc" key? 1

Status
Not open for further replies.

Fursten

Programmer
Dec 27, 2000
403
0
0
PT
HI,

I´m trying to do this in my application:

After I open any form, I would like to close it, if the "esc" key is pressed by the user. I can´t put it inside the keypress event because I would need to put it in every contol´s keypress event...

Maybe there is an API to do this... Any ideias?

Thank you!
 
set the form's KeyPreview property to True then you'll only have to write a keypress event for the form

 
Hi,

I ddin´t know about that property.

Thank you :)
 
Thanks JustinE*

I didn't know that one either, saved me a LOT of key checking in all the routines...

Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top