zoukankan      html  css  js  c++  java
  • C#窗体排列方式

    2020-03-11 每日一例第3天

    1.设置父窗体属性;IsMdicontainer设置成true;

    2.拖入menustrip控件,修改标题栏中的text文字。

    3.点击“加载子窗体”设置代码:

    Form frm1 = new Form();
    frm1.MdiParent = this;
    frm1.Show();
    frm1.Text = "窗体1";

    Form frm2 = new Form();
    frm2.MdiParent = this;
    frm2.Show();
    frm2.Text = "窗体2";

    4.点击“水平平铺”设置代码:

      LayoutMdi(MdiLayout.TileHorizontal);

    5.点击“垂直平铺”设置代码:

          LayoutMdi(MdiLayout.TileVertical);

    6.例题完成,最后效果如下:

     

    7.完整代码如下:

    private void 加载子窗体ToolStripMenuItem_Click(object sender, EventArgs e)
    {
    Form frm1 = new Form();
    frm1.MdiParent = this;
    frm1.Show();
    frm1.Text = "窗体1";

    Form frm2 = new Form();
    frm2.MdiParent = this;
    frm2.Show();
    frm2.Text = "窗体2";
    }

    private void 水平平铺ToolStripMenuItem_Click(object sender, EventArgs e)
    {
    LayoutMdi(MdiLayout.TileHorizontal);
    }

    private void 垂直平铺ToolStripMenuItem_Click(object sender, EventArgs e)
    {
    LayoutMdi(MdiLayout.TileVertical);
    }

     

  • 相关阅读:
    WEB
    Python
    Git
    JavaScript
    鸡汤
    面向对象
    Python
    Python
    MongoDB
    Oracle 11g 安装
  • 原文地址:https://www.cnblogs.com/ljs7490/p/12452704.html
Copyright © 2011-2022 走看看