winform窗口关闭提示

private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (MessageBox.Show("你确定要退出本系统吗?", "退出", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.OK)
{
Application.ExitThread();
}
else { e.Cancel = true; }
}
posted @ 2010-03-18 19:50  与时俱进  阅读(625)  评论(0编辑  收藏  举报
友情链接:同里老宅院民居客栈