-1
我正在使用C#创建窗体窗体应用程序。我正在使用MDI界面。窗体关闭事件
但我要作出这样的:
private void Earnings_Leave(object sender, EventArgs e)
{
DialogResult result = MessageBox.Show("Are you sure to Quite this form","confirmation Message", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if(result==DialogResult.Yes)
{
this.Close();
}
else if (result == DialogResult.No)
{
Earnings sibling = new Earnings();
sibling.MdiParent = this.MdiParent;
sibling.Show();
}
}
但这种不正常的形式将在两种情况下关闭,请帮助我。