代码
private void frmMDIMain_FormClosing(object sender, FormClosingEventArgs e)
{
if (e.CloseReason != CloseReason.ApplicationExitCall)
{
DialogResult re = MessageBox.Show(resourceClose,resourceCloseTip, MessageBoxButtons.YesNo, MessageBoxIcon.Information);
if (re == DialogResult.Yes)
{
e.Cancel = false;
Application.Exit();
}
else
{
e.Cancel = true;
}
}
}
{
if (e.CloseReason != CloseReason.ApplicationExitCall)
{
DialogResult re = MessageBox.Show(resourceClose,resourceCloseTip, MessageBoxButtons.YesNo, MessageBoxIcon.Information);
if (re == DialogResult.Yes)
{
e.Cancel = false;
Application.Exit();
}
else
{
e.Cancel = true;
}
}
}