关闭程序 提示 C#

private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
DialogResult dr = MessageBox.Show("是否关闭?","提示!",MessageBoxButtons.OKCancel);
if(dr!=DialogResult.OK)
{
e.Cancel = true;
}
}

 

posted on 2013-07-27 10:25  冬夜冷雨  阅读(317)  评论(0编辑  收藏  举报

导航