Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Closing all windows using control box exit

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have a problem where by the application is not unloaded correctly when the control box exit button is pressed on the top tool bar. I need to keep the control box active so I can minimise. How can I close all active windows when this button is pressed.
Thanks
John Macleod
 
Your main form's QueryUnload event supplies an argument called UnloadMode. You can use this to tell how the form came to be unloaded, and perform any necessary cleanup before the unload actually occurs.

UnloadMode values:

0 = closed via control box or "x" button
1 = closed via code, e.g. "Unload frmMain"
2 = closed by Windows because Windows is shutting down
3 = close via Task Manager
4 = MDI parent is closing


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top