请问怎样把一个子窗口放到主窗口中,子窗口和主窗口是互相连接的,就是子窗口显示在主窗口里面,希望高手帮助

解决方案 »

  1.   

    设置主窗体的IsMdiContainer为true,并添加一个子窗体,在主窗体的某个组件触发事件
    Form2 f2=new Form2();
    f2.MdiParent=this;
    f2.show();
      

  2.   

    父窗体Parent 子窗体Child在Parent窗体的事件中实例化Child窗体,并设置该实例的Parent属性为当前窗体对象即可。Child child = new Child();
    child.Parent = this;
      

  3.   

          private void toolStripMenuItem2_Click(object sender, EventArgs e)
            {
             
                Form2 f2 = new Form2();
                f2.MdiParent = this;
                f2.Show();
                
            }
    代码就是这样的,属性需要设置什么吗