|
-
Jun 5th, 2010, 09:47 PM
#9
Re: The "X" Button
 Originally Posted by JuggaloBrotha
This doesn't make any sense. If you set e.Cancel to true (which takes effect after the sub has finished) and you call me.Close from inside of it, you're going to get the FormClosing event raised again, where you're setting e.Cancel to True all over again. It'd never let the form close.
What you should do is set e.Cancel to True under 2 conditions: you've prompted the user for confirmation and they choose the cancel the form's close or something fails during the cleanup process and you want to keep the form open a little longer to let the user try closing it again later.
Also, when canceling the FormClosing event, always let the form close if: Windows is shutting down, or the user kills the app from the Taskmanager. Both of these can be tested for under e.CloseReason
I thought checking for conditions would be implied.
CodeBank contributions: Process Manager, Temp File Cleaner
 Originally Posted by SJWhiteley
"game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|