void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (MessageBox.Show(
"窗口关闭后,数据即将丢失!是否现在关闭窗口",
"提示",
MessageBoxButtons.OKCancel,
MessageBoxIcon.Question) != DialogResult.OK)
{
e.Cancel = true;
return;
}
}
void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (MessageBox.Show(
"窗口关闭后,数据即将丢失!是否现在关闭窗口",
"提示",
MessageBoxButtons.OKCancel,
MessageBoxIcon.Question) != DialogResult.OK)
{
e.Cancel = true;
return;
}
}