How to stop a textbox beeping when I press Escape key

wickyd

Member
Joined
Oct 22, 2006
Messages
5
Programming Experience
Beginner
Hi folx

I want to close a form (as if the user had clicked on the Cancel button) when the user presses the Escape button.

- The form has: 1 label, 1 textbox, an OK button and a Cancel button.
- The textbox has focus by default.
- If I press the escape key while the textbox has focus, the form beeps.
- If I change the textbox to multiline, which is undesireable, it does not beep.

With that in mind, how do I stop the textbox from beeping (once) before the form hides?

Thank you.

Kind regards
wickyd
 
set the form's "CancelButton" property to your cancel button
then whenever you press the escape key the form automaticall clicks your cancel button for you
 
Back
Top