mercredi 6 mai 2015

how to remain the form open when x button(in the upper right most) is clicked?

I'm having a problem with my form in VB.net. I want to remain my form open when I clicked no in the decision box.

this is my code:

Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
        If (MsgBox("Do you want to quit now?", MsgBoxStyle.YesNo).ToString = "Yes") Then
            Dim login As New login
            login.Show()
        Else
            'remain my form
        End If
    End Sub

Please help me. thankyou.

Aucun commentaire:

Enregistrer un commentaire