Dim newfrm As New frmChild
                newfrm.MdiParent = Me
                newfrm.Show()

解决方案 »

  1.   

    C#的frmChild child1 = new frmChild ();
    child1.MdiParent = this;  //必须要设置MdiParent属性
    child1.Show ();
      

  2.   

    chenjiaxiong(月光宝盒) ,你用的是VB;不过,我没有使用了哦,现在是在C#技术区里面哦
    不过还是谢谢了
    quanlm(工兵) ,谢谢了,这样子好像不行哦,没有显示子窗口啊
      

  3.   

    BaseChild child=new BaseChild();
    child.Text=menuItem.Text;
    child.Tag = menuItem.TagNo;
    child.MdiParent=this;
    child.WindowState=FormWindowState.Maximized;
    child.Show();
      

  4.   

    参考:
    private bool IsWindowExisted(string sFormText, string sTagName, int iTagImg)
    {
    Form[] charr= this.MdiChildren; //for each child form set the window state to Maximized
    foreach (Form chform in charr)
    {
    if (chform.Name == sFormText)
    {
    chform.Activate();
    lbTagName.ImageIndex = iTagImg;
    lbTagName.Text = sTagName;
    return true;
    }
    }
    return false;
    }
    创建子窗体:
    frmType dataForm = new frmType();
    if (IsWindowExisted(dataForm.Name, dataForm.sTagName, dataForm.iTagImg)==false)
    {
    dataForm.MdiParent = this;
    dataForm.Show();
    lbTagName.ImageIndex = dataForm.iTagImg;
    lbTagName.Text = dataForm.sTagName;
    }
      

  5.   

    this.frmMain.MdiParent=true;//frmMain表示主窗体实例
    frmChild child = new frmChild ();
    child.MdiParent = this;  
    child1.Show ();