Created
August 13, 2013 16:00
-
-
Save viko16/6222687 to your computer and use it in GitHub Desktop.
点击退出时需要确认 #winform
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void MainForm_FormClosing(object sender, FormClosingEventArgs e) | |
{ | |
if (MessageBox.Show("是否确认退出程序?", "退出", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) | |
{ | |
// 关闭所有的线程 | |
this.Dispose(); | |
this.Close(); | |
} | |
else | |
e.Cancel = true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment