Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Programing the red X at the top of the form
Message
From
03/11/2013 14:07:36
 
 
To
03/11/2013 13:20:16
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01587193
Message ID:
01587197
Views:
86
some of our users still want to be able hit the red x at the top of the form. Therefore
I need a way to program the red x to set m0flag to 'quit' before it releases the form. I can't use the lost focus,
or destroy event buttons because when the Save button releases the form that event is activated and the
loop is exited.

I only want to exit the loop if the x is clicked.


Check out the form's QueryUnload() method - it fires whenever the user clicks on the form's close button (the red X in the upper right hand corner). You could call a method from that method to ask the user if he or she wants to save changes before exiting and then take appropriate action. If you do not want the form to close, just issue as NODEFAULT in the QueryUnload() method.
Previous
Reply
Map
View

Click here to load this message in the networking platform