第一个窗口中
public delegate void ChildClose();
private void button1_Click(object sender, EventArgs e)
{
this.Hide();
MainForm fm = new MainForm();
fm.closeFather += new ChildClose(this.Close);
fm.ShowDialog();
}
弹出窗口中
public event ChildClose closeFather;//关闭父窗口
private void MainForm_FormClosed(object sender, FormClosedEventArgs e)//关闭窗口响应,连同父窗口一起关闭
{
closeFather();
}