日期:2014-05-20 浏览次数:20898 次
private EventHandler CloseDialog;
private Form form1 = new Form1();
private Form form2 = new Form2();
private void CloseForm1(object sender,EventArgs e)
{
form1.Close();
}
private void CloseForm2(object sender, EventArgs e)
{
form2.Close();
}
public FrmMain()
{
this.CloseDialog += CloseForm1;
this.CloseDialog += CloseForm2;
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
form1.Show();
}
private void button2_Click(object sender, EventArgs e)
{
form2.Show();
}
private void button3_Click(object sender, EventArgs e)
{
CloseDialog(this, null);
}