MdiLayout枚举成员及说明
Casecade s全部Mdi层叠在父窗体
TileHorizontal 水平平铺
TitleVertical 垂直平铺
Form1.cs (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 Test1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void Form1_Load(object sender, EventArgs e)
{ } private void 载入子窗口ToolStripMenuItem_Click(object sender, EventArgs e)
{
Form2 frm2 = new Form2(); //实例化 Form2
frm2.MdiParent = this; //设置MdiParent属性,将当前窗口作为父窗
frm2.Show(); //使用show方法打开窗口
Form3 frm3 = new Form3();
frm3.MdiParent = this;
frm3.Show();
Form4 frm4 = new Form4();
frm4.MdiParent = this;
frm4.Show();
} private void 水平平铺ToolStripMenuItem_Click(object sender, EventArgs e)
{
LayoutMdi(MdiLayout.TileHorizontal);
} private void 垂直平铺ToolStripMenuItem_Click(object sender, EventArgs e)
{
LayoutMdi(MdiLayout.TileVertical);
} private void 层叠排列ToolStripMenuItem_Click(object sender, EventArgs e)
{
LayoutMdi(MdiLayout.Cascade);
}
}
}


Form1.Designer
namespace Test1
{
partial class Form1
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null; /// <summary>
/// 清理全部正在使用的资源。
/// </summary>
/// <param name="disposing">假设应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
} #region Windows 窗口设计器生成的代码 /// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器改动此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.载入子窗口ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.水平平铺ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.垂直平铺ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.层叠排列ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.载入子窗口ToolStripMenuItem,
this.水平平铺ToolStripMenuItem,
this.垂直平铺ToolStripMenuItem,
this.层叠排列ToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(648, 25);
this.menuStrip1.TabIndex = 1;
this.menuStrip1.Text = "menuStrip1";
//
// contextMenuStrip1
//
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(61, 4);
//
// 载入子窗口ToolStripMenuItem
//
this.载入子窗口ToolStripMenuItem.Name = "载入子窗口ToolStripMenuItem";
this.载入子窗口ToolStripMenuItem.Size = new System.Drawing.Size(80, 21);
this.载入子窗口ToolStripMenuItem.Text = "载入子窗口";
this.载入子窗口ToolStripMenuItem.Click += new System.EventHandler(this.载入子窗口ToolStripMenuItem_Click);
//
// 水平平铺ToolStripMenuItem
//
this.水平平铺ToolStripMenuItem.Name = "水平平铺ToolStripMenuItem";
this.水平平铺ToolStripMenuItem.Size = new System.Drawing.Size(68, 21);
this.水平平铺ToolStripMenuItem.Text = "水平平铺";
this.水平平铺ToolStripMenuItem.Click += new System.EventHandler(this.水平平铺ToolStripMenuItem_Click);
//
// 垂直平铺ToolStripMenuItem
//
this.垂直平铺ToolStripMenuItem.Name = "垂直平铺ToolStripMenuItem";
this.垂直平铺ToolStripMenuItem.Size = new System.Drawing.Size(68, 21);
this.垂直平铺ToolStripMenuItem.Text = "垂直平铺";
this.垂直平铺ToolStripMenuItem.Click += new System.EventHandler(this.垂直平铺ToolStripMenuItem_Click);
//
// 层叠排列ToolStripMenuItem
//
this.层叠排列ToolStripMenuItem.Name = "层叠排列ToolStripMenuItem";
this.层叠排列ToolStripMenuItem.Size = new System.Drawing.Size(68, 21);
this.层叠排列ToolStripMenuItem.Text = "层叠排列";
this.层叠排列ToolStripMenuItem.Click += new System.EventHandler(this.层叠排列ToolStripMenuItem_Click);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.Window;
this.ClientSize = new System.Drawing.Size(648, 309);
this.Controls.Add(this.menuStrip1);
this.IsMdiContainer = true;
this.MainMenuStrip = this.menuStrip1;
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout(); } #endregion private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem 载入子窗口ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 水平平铺ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 垂直平铺ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 层叠排列ToolStripMenuItem;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; }
}


Form2.cs  Form3.Cs Form4.cs 为默认值



最新文章

  1. Enterprise Solution 2.3
  2. HTML5 aria- and role
  3. Java--类的使用
  4. Android EditText内容监听
  5. poj3274 哈希
  6. C++ Tempatet之模板模型
  7. DuiLib消息处理剖析
  8. 【转】monkeyrunner学习总结二:连接、安装、启动
  9. C# 知识点记录(持续更新中)
  10. 分享基于分布式Http长连接框架--设计模型
  11. HBase新的客户端接口
  12. angularjs学习笔记之一
  13. 第二部分之Redis服务器(第十四章)
  14. JMeter关联的几种方式总结案例
  15. android 工具库
  16. 好程序员分享居中一个float元素
  17. 第二阶段第九次spring会议
  18. POJ3348 Cows 计算几何 凸包
  19. 用where导致group by分组字段的索引失效
  20. Dapper使用总结

热门文章

  1. MOOC即Massive Open Online Course的缩写
  2. 用Django搭建个人博客—(2)
  3. WPF扩展标记
  4. C# 数据结构 栈 Stack
  5. 如何查看Windows下端口占用
  6. Google提议使用Jsonnet来增强JSON
  7. 三大框架SSH(struts2+spring+hibernate)整合时相关配置文件的模板
  8. QT获得所有系统环境变量(包括Linux和MAC的信息)
  9. 《Apache Spark源码剖析》
  10. 等方案及设备提供商 有需要的可以联系QQ561454825,电话:13779953060,我们提供最专业的无线WIFI认证系统及根据您的需要修改软件