private
ChildFrm myChildFrm;
//
定义子窗口对象
private void button1_Click( object sender, EventArgs e)
{
if (myChildFrm == null || myChildFrm.IsDisposed)
{
myChildFrm = new ChildFrm();
}
this .IsMdiContainer = true ;
myChildFrm.MdiParent = this ; // 建立父子关系
myChildFrm.Show(); // 显示子窗口
myChildFrm.Focus(); // 子窗口获得焦点
}
private void button1_Click( object sender, EventArgs e)
{
if (myChildFrm == null || myChildFrm.IsDisposed)
{
myChildFrm = new ChildFrm();
}
this .IsMdiContainer = true ;
myChildFrm.MdiParent = this ; // 建立父子关系
myChildFrm.Show(); // 显示子窗口
myChildFrm.Focus(); // 子窗口获得焦点
}