private void BtnCloseEdit_Click(object sender, EventArgs e)
{
try
{
if (BtnSaveNotepad.Enabled)
{
DialogResult dr = MessageBox.Show("关闭前是否保存最后更改的内容?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dr == DialogResult.Yes)
{
if (string.IsNullOrEmpty(txtNotepadTitle.Text.Trim()))
{
MessageBox.Show("请输入标题");
return;
}
SaveNotepad();
}
}
panelEditNotepad.Visible = false;
}
catch (Exception ex)
{
log.WriteLog(ex.ToString());
}
finally
{
if (bianqianTimer.Enabled) bianqianTimer.Stop();
}
}