p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

pro_vb thread: Cancel unload form


Message #1 by "Hiap" <svr4@m...> on Wed, 4 Apr 2001 06:49:53
Try the following code.

Private Sub Form_QueryUnload(Cancel As Integer,
UnloadMode As Integer)
 Cancel = MsgBox("Do you want to exit?", vbOKCancel)
     If Cancel = 1 Then Cancel = 0
End Sub
Regards Indranil 
> -----Original Message-----
> From: Hiap [mailto:svr4@m...]
> Sent: 04 April 2001 08:50
> To: professional vb
> Subject: [pro_vb] Cancel unload form
> 
> 
> I want to make a form that is when someone click the
> cross button on the 
> control box of the form - that is trying to exit - a
> warning box will be 
> showed up asking whether to continue exit the form
> or cancel it. When then 
> he click Cancel button the form will not unload. Can
> anyone tell me how to 
> make such form ? 

  Return to Index