A
_AnonCoward
I have a windows GUI application (vb.net 2.0) and I need to manage how
it is closed. I want to have a single function that is called whenever
the user tries the close the app regardless of how:
* User selects File|Exit from the main menu
or clicks a [Close] button.
* the system is being shut down via the [X]
button, or the system menu from the task
bar (etc.)
My objective is to have this function perform the following tests:
[1] if there isn't a current document loaded
return True
[2] if the current document isn't "dirty",
return True
[3] prompt the user to save the document. If
that succeeds, return True. If the save
fails or the user cancels the action,
Return False
If the function returns True, the shut down will be allowed to
continue. If it returns false, the shut down will be aborted.
Any suggestions on the best approaches to take for this?
Ralf
it is closed. I want to have a single function that is called whenever
the user tries the close the app regardless of how:
* User selects File|Exit from the main menu
or clicks a [Close] button.
* the system is being shut down via the [X]
button, or the system menu from the task
bar (etc.)
My objective is to have this function perform the following tests:
[1] if there isn't a current document loaded
return True
[2] if the current document isn't "dirty",
return True
[3] prompt the user to save the document. If
that succeeds, return True. If the save
fails or the user cancels the action,
Return False
If the function returns True, the shut down will be allowed to
continue. If it returns false, the shut down will be aborted.
Any suggestions on the best approaches to take for this?
Ralf