|
-
April 30th, 2003, 08:52 AM
#1
Form KeyPress event
Hi
i would like to let the user close the form by pressing the escape button.
I tried to edit the keyPress event of the form, but that doesn't work...nothing append.
To do that ... do i have to edit the keypress event for each of the controls that are in my form ?
Thanks for your help
Alexandre
-
April 30th, 2003, 09:13 PM
#2
If you have an exit button, you could set the form's CancelButton property to it. The CancelButton is called automatically when the user presses the Escape Key.
Or you can trap for the Escape Key in the KeyUp or KeyDown events. I can't rember for sure, but I think these events will fire for the Escape key while the KeyPress event won't??
Hope this helps.
That which does not kill us, only makes us stronger.
MCSD .NET
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|