子界面:
      namespace csglTest
   {
       partial class Form_Search : Form
      {
          public Form_Search(csglTest.Form_Main parent)
          {
            InitializeComponent();
            this.MdiParent = parent;
          }
      }
   }主界面:
namespace csglTest
{
    partial class Form_Main : Form
    {
        public Form_Main()
        {
            InitializeComponent();
        }
    }
}菜单中查找项:        private void 查找ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            csglTest.Form_Search form_search = new csglTest.Form_Search(this);
            form_search.Show();
        }主界面IsMdiContainer已经设为True,点击菜单查找项却没有子界面出来,怎么回事??调试时发现form_search确实生成了...但是就是显示不出来...

解决方案 »

  1.   

    关于Multiple Document Interface,楼主可以在百度、谷歌、csdn …随便一搜索,您就可以看到很多了…
      

  2.   

    呵呵,刚才写错了,作为补偿给你一个我的,可能对你有帮助~
    public partial class MainForm : Form
        {
            private studentAddForm f1 = new studentAddForm();
            private studentSearchForm f2 = new studentSearchForm();
            public MainForm()
            {
                InitializeComponent();
            }        private void 添加学生ToolStripMenuItem_Click(object sender, EventArgs e)
            {
                if (f1.IsDisposed)
                {
                    f1 = new studentAddForm();
                }
                else
                {
                    ;
                }
                f1.MdiParent = this;
                f1.Show();
                f1.Focus();
            }        private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
            {
                this.Close();
            }        private void 查询学生ToolStripMenuItem_Click(object sender, EventArgs e)
            {
                if (f2.IsDisposed)
                {
                    f2 = new studentSearchForm();
                }
                else
                {
                    ;
                }
                f2.MdiParent = this;
                f2.Show();
                f2.Focus();
            }
        }