private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
DialogResult dr = new DialogResult();
dr = MessageBox.Show("关闭", "关闭", MessageBoxButtons.YesNo);
if (dr == DialogResult.Yes)
{
MessageBox.Show("关闭");
}
else
{
MessageBox.Show("不关闭");
e.Cancel = true;
}
}
{
DialogResult dr = new DialogResult();
dr = MessageBox.Show("关闭", "关闭", MessageBoxButtons.YesNo);
if (dr == DialogResult.Yes)
{
MessageBox.Show("关闭");
}
else
{
MessageBox.Show("不关闭");
e.Cancel = true;
}
}