日期:2014-05-18 浏览次数:20874 次
BOO1HELP BOO1HELP1= new BOO1HELP();//在MainA001是主窗体里写 BOO1HELP1.MdiParent = this; BOO1HELP1.Show();
------解决方案--------------------
BOO1HELP.ShowDialog();
------解决方案--------------------
Child.ShowDialog();
Child.Show(this);
------解决方案--------------------
设置MdiParent属性
------解决方案--------------------
this.MdiParent=true;
------解决方案--------------------
父窗体
this.MdiParent=true;
子窗体
构造函数:
public child(Form Parent){
this.MdiParent = Parent;
}
/////////
chaild ch = new child(this);
.........
------解决方案--------------------
父窗体
public partial class frmContainer : Form
{
public frmContainer()
{
InitializeComponent();
MdiBasic.frmChild child = new MdiBasic.frmChild(this);
child.Show();
}
}
子窗体
public partial class frmChild : Form
{
public frmChild(frmContainer parent)
{
InitializeComponent();
this.MdiParent = parent;
}
private void InitializeComponent()
{
..........
this.IsMdiContainer = true;
}
}
------解决方案--------------------
父窗体
public partial class formParent : Form
{
public formContainer()
{
InitializeComponent();
formChild child = new formChild(this);
child.Show();
}
}
子窗体
public partial class formChild : Form
{
public frmChild(formParent parent)
{
InitializeComponent();
this.IsMdiContainer = true;
this.MdiParent = parent;
}
}
------解决方案--------------------