日期:2014-05-17 浏览次数:20991 次
private void Main_FormClosed(object sender, FormClosedEventArgs e)
{
if(baocun==false)
{
if(richTextBox1.Text!="")
{
string msg = "当前文本内容不为空,是否保存";
if (baocun == false && filepath != "")
msg = "内容已经发生变化,是否保存";
switch (MessageBox.Show(msg,"警告",MessageBoxButtons.YesNoCancel))
{
case DialogResult.Yes:
if(SaveFile())
{
Application.Exit();
}
break;
case DialogResult.No:
e.Cancel = false;
break;
case DialogResult.Cancel:
e.Cancel = true;
break;
}
}
&n