Windows Develop Bookmark and Share   
 index > Windows Forms General > Form_FormClosing behavior
 

Form_FormClosing behavior

I have an event that closes the main form (the app essentially).

However the app could be busy (same thread) with 2 potentially long running methods called from a timer.

When Close() is called (from another class or from a callback in the same form) does it wait for these methods to complete?

cablehead  Tuesday, July 11, 2006 9:40 PM

No. But you can handle the closing event and set the flag in the closingeventargs passed in to not close the app.

cgraus  Tuesday, July 11, 2006 9:50 PM

No. But you can handle the closing event and set the flag in the closingeventargs passed in to not close the app.

cgraus  Tuesday, July 11, 2006 9:50 PM

Figured..

Going to have to re-design to:

Method1();

Method2();

this.Close();

cablehead  Tuesday, July 11, 2006 11:15 PM

You can use google to search for other answers

Custom Search

More Threads

• Toolstripmenuitem used between mainmenu and contextmenu
• bring richtextbox forward programmatically
• Custom Control can't be used
• Delagates
• Checking for a null entry in a textbox
• detailed listview questions
• topmost, transparent form (using transparencyKey) with a usercontrol in its center
• sendkeys (or another method) to an inactive window?
• Form closing after adding "OK" and "Cancel" buttons
• picture box proportional to original image file, even while resizing.