how to close messageBox?

G

Guest

hi,
i have a module that created a form, and the messageBox is shown in
the closing event , but when the im choosing the "cancel" button in the
messageBox the messageBox and also the form is getting closed
i want the messageBox to close (without the form )?
how to close only the messageBox?
thanks in advanced


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