monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4">void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (MessageBox.Show(
"窗口关闭后,数据即将丢失!是否现在关闭窗口",
"提示",
MessageBoxButtons.OKCancel,
MessageBoxIcon.Question) != DialogResult.OK)
{
e.Cancel = true;
return;
}
}