![](/img/trans.png)
[英]Ext.net - MessageBox confirm only shows ONCE in entire for loop
[英]FormClosing shows Exit Confirm MessageBox two times
我在关闭表单时遇到问题。 它显示2次我的退出确认消息框,并询问2次“确定要退出吗?”:
if (MessageBox.Show("Are you sure to exit. Confirm?", "Rest O Rant", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
Application.Exit();
MessageBox.Show("Thank You For Using Rest O Rant Software.", "Closing message!", MessageBoxButtons.OK);
}
else
{
e.Cancel = true;
this.Activate();
}
试试这个代码
MessageBox.Show("Thank You For Using Rest O Rant Software.", "Closing message!", MessageBoxButtons.OK);
Application.Exit();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.