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 为默认值



C#-Mdi多文档窗体及其子窗体的排列 ---ShinePans的更多相关文章

  1. delphi 判断MDI窗体的子窗体是否存在

    //***************************************************************************//函 数名: CreateForm //返 ...

  2. 判断MDI窗体的子窗体是否存在

    //***************************************************************************//函 数名: CreateForm//返 回 ...

  3. delphi判断MDI窗体的子窗体是否存在

    转]delphi判断MDI窗体的子窗体是否存在//*************************************************************************** ...

  4. 附实例!实现iframe父窗体与子窗体的通信

    欢迎大家前往腾讯云+社区,获取更多腾讯海量技术实践干货哦~ 本文由前端林子发表于云+社区专栏 本文主要会介绍如何基于MessengerJS,实现iframe父窗体与子窗体间的通信,传递数据信息.同时本 ...

  5. C#之菜单控件、主窗体打开子窗体、GroupBox控件使用

    一.背景 一年前有学习过C#,但没有在项目中去实际做APP,重新捡起来应用到项目中.我同事本来做好一个CANOPEN设备管理的界面,由于近期搜索了别人的开发的界面,我觉得有很多东西要重新安排,以及我已 ...

  6. winform里操作打开在panel里的form窗体,子窗体操作同级子窗体或者父窗体的方法

    最近开始了一个winform项目,原先一直都是web项目.遇到个问题,就是在框架内,左侧和中间的main都是用panel来实现的form,就是把form窗体打开到panel里,实现左侧是导航,中间是操 ...

  7. Caliburn.Micro 关闭父窗体打开子窗体

    比如我们在做登录的时候需要关闭父窗体打开子窗体.使用Caliburn.Micro它的时候我们关闭登录窗口的时候主页面也会关闭. 解决方法就是在登录页面的CS里面写 IndexView iv = new ...

  8. C# 关闭子窗体释放子窗体对象问题

    1 在主窗口中实例化子窗口 Form2 f2 = new Form2(); 2 通过按钮来显示子窗口 f2.Show(); 3 关闭子窗口而不释放子窗口对象的方法 protected override ...

  9. C#_父窗体跟子窗体的控件操作

    很多人都苦恼于如何在子窗体中操作主窗体上的控件,或者在主窗体中操作子窗体上的控件.相比较而言,后面稍微简单一些,只要在主窗体中创建子窗体的时候,保留所创建子窗体对象即可. 下面重点介绍前一种,目前常见 ...

  10. 界面主窗体,子窗体的InitializeComponent(构造函数)、Load事件执行顺序

    主窗体,子窗体的InitializeComponent(构造函数).Load事件执行顺序1.执行主窗体定义事件 new函数时,同时执行主窗体构造函数,默认就一个InitializeComponent函 ...

随机推荐

  1. ajax 异步上传视频带进度条并提取缩略图

    最近在做一个集富媒体功能于一身的项目.需要上传视频.这里我希望做成异步上传,并且有进度条,响应有状态码,视频连接,缩略图. 服务端响应 { "thumbnail": "/ ...

  2. 编译u-boot命令和u-boot常用命令

    一.编译u-boot命令 1.配置开发板 #make TQ2440_config 2.编译 #make all 3.交叉编译器是crosstools_3.4.5_softfloat” 使用4.3.3版 ...

  3. iOS:不同属性声明方式的解析

    代码: /* 属性声明方式说明: ----------------------- 1 @interface ... { id name } @end 这样声明的属性其实可以认为是private属性,因 ...

  4. [转]hive中order by,distribute by,sort by,cluster by

    转至http://my.oschina.net/repine/blog/296562 order by,distribute by,sort by,cluster by  查询使用说明 1 2 3 4 ...

  5. JAVA抽象类和接口的深入探讨

    Java 语言中,抽象类(abstract class) 和接口(interface) 是抽象思想的两种体现形式.初学者很容易把这两者搞混,所以Java面试中考抽象类和接口的区别的面试题也常有出现的. ...

  6. Bomb Game

    hdu3622:http://acm.hdu.edu.cn/showproblem.php?pid=3622 题意:你有n次,每次你可以在平面上放置一个点,并且每一次都会有两个位置可以选,每一次只能选 ...

  7. Android 设置隐式意图

    AndroidManifest.xml对于被调用的activity: <activity android:name="com.wuyou.twoactivity.OtherActivi ...

  8. 【POI2003/2004 stage I】

    [原题在此] Let us consider a game on a rectangular board m x 1 consisting of m elementary squares number ...

  9. 三大框架SSH(struts2+spring+hibernate)整合时相关配置文件的模板

    最近在学SSH三大框架的整合,在此对他们整合时相关配置文件做一简单的模板总结,方便以后复用! 首先是web.xml配置文件,这里面就配置一些简单的监听器.过滤器,包括spring核心配置文件appli ...

  10. centos本地源搭建——iso

    说明:centos源搭建比另一篇ubuntu源搭建简单些,操作也简单.思路是用iso制作一个本地源,后期需要新软件可以自己添加. 1.进入iso挂载路径,这里是虚拟机,在vm上挂载,在linux下直接 ...