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();
form2 b=new form2();
b.owner=this;
b.show();
this.hide();
b中显示a:
form1 a=(form1)this.owner;
a.show();
this.hide();//this.close();
a的ListView设为public
form1 a=(form1)this.owner;
a.ListView.XXX
就可以引用了
{
Form1 form1;
public Form2(Form1 form1)
{
this.form1=form1;
}
private void Form2_Closed(object sender, System.EventArgs e)
{
this.form1.show();
}
}
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();
}
}
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;
}
}以上~~~不知道是否合你用了