how to close messageBox?

G

Guest

hi,
how to close messageBox (and the form wont be closed too) ???
i tried it with close and dispose but then the form is closed too.
thanks
 
W

W.G. Ryan eMVP

Is the MessageBox being shown in a procedure where the form variable is
going out of scope? This shouldn't be happening unless it is or something
wierd is going on behind the scenes. IF you post the code I could probably
be of more help.
 
G

Guest

thanks for the reply
well...i have a module that created a form, and the messageBox is shown in
the closing event
i hope u will be able to help me....
thank you


Private Sub teacher_Closing(ByVal sender As Object, ByVal e As
System.ComponentModel.CancelEventArgs) Handles MyBase.Closing

Select Case MessageBox.Show("Do you want to save changes?", " ",
MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning,
MessageBoxDefaultButton.Button1)
Case DialogResult.Cancel

Case DialogResult.No
Me.Dispose()
Case DialogResult.Yes
saveAll()
End Select
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top