Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trapping the exitting of a form
Message
 
To
23/08/1999 18:33:48
Ronald Suen
Epic Solutions Inc.
Edmonton, Alberta, Canada
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00256846
Message ID:
00256853
Views:
17
>I wish to trap the exitting of the form so that I can prompt the user to confirm ending the transaction. If they select "no", I do not want to close the form. Note that I want this message to appear if they click the close button (in the top right corner of the window) or if they click a "cancel" button that I've placed on the form. How do I do this?
>
>Thanks,

Ronald, you should use form QueryUnload to place the confirm code.
Issue NODEFAULT and return .F. from this method if the user chooses "No". In your Cancel button you need to call the form.QueryUnload() method before you do Release() the form.
It may look like:

*cmdCancel.Click()
IF thisform.QueryUnload()
*... do something
thisform.Release()

Nick
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