469,950 Members | 1,391 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,950 developers. It's quick & easy.

how to close messageBox?

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,
Case DialogResult.Cancel

Case DialogResult.No
Case DialogResult.Yes
End Select
End Sub

Jul 21 '05 #1
3 2463
Hi s-galit,

In your Cancel case set e.Cancel = true

Happy Coding!
Morten Wennevik [C# MVP]
Jul 21 '05 #2
you have been very helpul
Jul 21 '05 #3
you have been very helpul
Jul 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by PawelR | last post: by
1 post views Thread by Ebrahim | last post: by
1 post views Thread by Alpha | last post: by
1 post views Thread by s-galit | last post: by
reply views Thread by archana | last post: by
3 posts views Thread by rdemyan via AccessMonster.com | last post: by
6 posts views Thread by Frank Rizzo | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.