所以这是我的代码.当我单击表单上的X按钮时,消息框显示并单击“无”,但是当我单击“是”时,消息框将关闭并快速再次出现,然后第二次单击任一按钮将关闭表单.它出什么问题了?
Private Sub Config_FormClosing(ByVal sender As System.Object,ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing Dim result = MessageBox.Show("Would you like to quit?",MessageBoxButtons.YesNo) If result = DialogResult.No Then e.Cancel = True ElseIf result = DialogResult.Yes Then Application.Exit() End If End Sub
提前致谢