Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 How to prevent the program from being closed?
Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Ashi_Mashi2




PostPosted: 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 Confused ....anyway...thanks agian
Sponsor
Sponsor
Sponsor
sponsor
Brightguy




PostPosted: 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.
betaflye




PostPosted: Mon May 02, 2005 7:28 pm   Post subject: (No subject)

Nice tip Brightguy
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: