How to prevent the program from being closed?
Author |
Message |
Ashi_Mashi2
|
Posted: Sat Apr 30, 2005 11:56 am Post subject: How to prevent the program from being closed? |
|
|
Hi guys,
thanks for your previous helps....now, i want to set a msgbox "Are you sure you want to exit?(vbYesNo)" that would appear when the user tries to close/unload the program. That's easy using Form_Unload. But, when the user clicks on the "X" button at the top of the screen...i can set the msgbox to appear using form_unload, but if the user chooses "No" then it would still unload the form...is there a way to prevent it? or maybe i should use another command istead of form_unload ....anyway...thanks agian |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Brightguy
![](http://compsci.ca/v3/uploads/user_avatars/527435178485ad4c287538.gif)
|
Posted: Sat Apr 30, 2005 6:43 pm Post subject: Re: How to prevent the program from being closed? |
|
|
Form_Unload has a Cancel variable passed to it (by reference). If the user chooses "No", then set Cancel to a nonzero value and the form will not unload. |
|
|
|
|
![](images/spacer.gif) |
betaflye
|
Posted: Mon May 02, 2005 7:28 pm Post subject: (No subject) |
|
|
Nice tip Brightguy |
|
|
|
|
![](images/spacer.gif) |
|
|