Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Escape key discard control changes
Message
 
To
05/06/1998 13:49:32
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00105232
Message ID:
00105261
Views:
40
>>>
>>>The advantage of 'Cancel' button is exactly what you seemingly don't like: going around last control Valid event. So, you can just go to Form.Keypress event, check for ESC there and run you code to close the form, etc.
>>
>>I have some forms with this way to close it: the keypress event of the form and the keypreview property of the form. But i've not tested if changes mades in last control are validated. Are they?
>>If you don't want, dont answer me. I'll test it. Thanks a lot.
>
>Actually, I don't remember exactly :), because I rarely, if ever, use Valid event. Anyway, if you or your users don't like 'Cancel' as they know it, you can replace it with KeyPress.
>There is one issue, which might be relevant here: if you have bound textbox and you want update controlsource automatically, then you must shift focus from this control.

just to add: or use custom WriteBuffer() method on exit from the form. You may put up the messagebox asking the user whether he wants to save the changes.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Reply
Map
View

Click here to load this message in the networking platform