a中打开b
form2 b=new form2();
b.owner=this;
b.show();
this.hide();
b中显示a:
form1 a=(form1)this.owner;
a.show();
this.hide();//this.close();

解决方案 »

  1.   

    2)窗体A调用窗体B,我用的是  new 窗体B.show() 之后我想把窗体B的数据添加到窗体A里的ListView控件里,怎么办啊?(注原来窗体A的ListView中有数据,只是在后面追加)
    a的ListView设为public
    form1 a=(form1)this.owner;
    a.ListView.XXX
    就可以引用了
      

  2.   

    owner 是什么东东啊?
      

  3.   

    Owner是主窗体啊,注意大小写,我只是随便写的没区分大小写,a中打开b的时候一定要有这句b.Owner=this;
      

  4.   

    public class Form2 : System.Windows.Forms.Form
    {
       Form1 form1;
       public Form2(Form1 form1)
    {
    this.form1=form1;
    }
       private void Form2_Closed(object sender, System.EventArgs e)
    {
              this.form1.show();
    }
    }
      

  5.   

    Form2 form2=new Form2(this);
    form2.Show();
    /////////////////////////////
    public class Form2 : System.Windows.Forms.Form
    {
       Form1 form1;
       public Form2(Form1 form1)
    {
    this.form1=form1;
    }
       private void Form2_Closed(object sender, System.EventArgs e)
    {
              this.form1.show();
    }
    }
      

  6.   

    第一个问题在A关闭的时候
    this.Hide();
    BForm B = new BForm();
    B.InstanceRef = this;
    B.Show();
    在B关闭时
    this.Hide();
    InstanceRef.Show();在窗体类中写上属性
    //取相关页面实例名
    public Form InstanceRef
    {
    get 
    {
    return m_InstanceRef;
    }
    set 
    {
    m_InstanceRef = value;

    }以上~~~不知道是否合你用了