MessageBox with YesNoCancel - No & Cancel triggers same event

前端 未结 9 1121
误落风尘
误落风尘 2020-12-04 21:23

I have a message box with the YesNoCancel buttons...

  • Pressing Yes will do some action and close the application - works fine
9条回答
  •  情书的邮戳
    2020-12-04 22:05

    Use:

    Dim n As String = MsgBox("Do you really want to exit?", MsgBoxStyle.YesNo, "Confirmation Dialog Box")
    If n = vbYes Then
        MsgBox("Current Form is closed....")
        Me.Close() 'Current Form Closed
        Yogi_Cottex.Show() 'Form Name.show()
    End If
    

提交回复
热议问题