c#点关闭没有反应,是怎么回事?
下面这段代码在我的form里没有反应是怎么回事?privatevoidForm1_FormClosing(objectsender,FormClosingEventArg...
下面这段代码在我的form里没有反应是怎么回事?
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
DialogResult dr = MessageBox.Show("是否关闭窗体", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (dr == DialogResult.Yes)
{
e.Cancel = false;
}
else
{
e.Cancel = true;
}
} 展开
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
DialogResult dr = MessageBox.Show("是否关闭窗体", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (dr == DialogResult.Yes)
{
e.Cancel = false;
}
else
{
e.Cancel = true;
}
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询