how to close messageBox?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • s-galit

    #1

    how to close messageBox?

    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.Componen tModel.CancelEv entArgs) Handles MyBase.Closing

    Select Case MessageBox.Show ("Do you want to save changes?", " ",
    MessageBoxButto ns.YesNoCancel, MessageBoxIcon. Warning,
    MessageBoxDefau ltButton.Button 1)
    Case DialogResult.Ca ncel

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

  • Morten Wennevik

    #2
    Re: how to close messageBox?

    Hi s-galit,

    In your Cancel case set e.Cancel = true

    --
    Happy Coding!
    Morten Wennevik [C# MVP]

    Comment

    Working...