Chapter 5. MDI窗体、菜单栏

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MDI窗体
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void 子窗体1ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            子窗体1 f2 = new 子窗体1();
            f2.MdiParent = this;
            f2.Show();
        }

        private void 子窗体2ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            子窗体2 f3 = new 子窗体2();
            f3.MdiParent = this;
            f3.Show();
        }

        private void 子窗体3ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            子窗体3 f4 = new 子窗体3();
            f4.MdiParent = this;
            f4.Show();
        }

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

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

posted @ 2016-07-03 09:23  庚xiao午  阅读(171)  评论(0编辑  收藏  举报