mdi主窗体Main 
子窗体SetPath.cs   和SetOrderPath.cs 
现在设置可以使   SetPath.cs成为Mdi子窗体     ,SetOrderPath.cs是SetPath.cs打开的新窗体,但是SetOrderPath.cs   设置为mdi子窗体后无法显示在Main   中, 
而是浮动中外面。     子窗体都是在Main   的splitContainer1中显示。我想是因为没有获取当前主窗体的对象,无法对其控件设置导致。 
请问各位高手如何做。我试过网上的几种方法   不行。 
谢谢!! 
 
 

解决方案 »

  1.   

    splitContainer1中可以显示Mdi子窗体吗?你是通过MdiParent来设置主窗体的吗?
    还是通过Controls.Add来添加的窗体?
      

  2.   

    //首先检查是否已打开窗口,如果已打开就激活它,否则就执行打开。
    if (this.checkChildFrmExist("FileForm") == true)
       {
           return;
       }
       FileForm frmChild = new FileForm();
       frmChild.WindowState = FormWindowState.Maximized;
       frmChild.MdiParent = this;
       frmChild.Show();