c# MDI 窗体设计

 

1.新建一个form,设为父窗体,在属性ismdicontainer中设置

 

2. 新建子窗口,设置其的父窗体

  Form fm2 = new Form2();
            fm2.MdiParent = this;
            fm2.Show();
            Form fm3 = new Form3();
            fm3.MdiParent = this;
            fm3.Show();
            Form fm4 = new Form4();
            fm4.MdiParent = this;
            fm4.Show();

4.对齐 layoutmdi

private void 纵向ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.TileHorizontal);
        }

        private void 横向ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.TileVertical);
        }

  

posted @ 2021-04-11 19:49  遥月  阅读(336)  评论(0编辑  收藏  举报