父窗口的定义
namespace Test
{
  
public delegate void ChildClose();
  
public partial class Parent : Form
  
{
    
private void btnLogIn_Click(object sender, EventArgs e)
    
{
       Chield ch 
= new Chield();
       ch.closeFather 
+= new ChildClose(this.Close);
       ch.Show();
       
this.Visible = false;
    }

  }

}
子窗口的定义:
namespace Test
{
  
public partial class Chield : Form
  
{
    
public event ChildClose closeFather;

    
public Chield ()
    
{
      InitializeComponent();
    }


    
private void Chield_FormClosed(object sender, FormClosedEventArgs e)
    
{
      closeFather();
    }

  }

}

posted on 2007-09-13 17:14  pdfw  阅读(5154)  评论(0编辑  收藏  举报