Esc key to exit form

H

Huyeote

I have a form which has more than 20 controls on it. I want to enabl
user to press Esc key to exit the form. I know I can use KeyUP o
KeyPress event of a single control to do it. But since there are tw
many controls and it's messy and time consuming to code for each one o
them. :confused: Is there an easy way to acheive it?

Thanks

Huyeot
 
K

keepITcool

Go to the properties of the close button on your form.
Set the Cancel property to true.

If the user presses escape.. the procedure attached to that
button is executed.
(see help on Msforms => Cancel property.


keepITcool

< email : keepitcool chello nl (with @ and .) >
< homepage: http://members.chello.nl/keepitcool >
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top