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. html5时间选择器

    HTML5日期输入类型(date)   分享   分享   分享   分享   分享 在很多页面和web应用中都有输入日期和时间的地方,最典型的是订飞机票,火车票,酒店,批萨等网站. 在HTML5之前 ...

  2. Elasticsearch客户端大全 http://www.searchtech.pro/elasticsearch-clients

    Elasticsearch有各种语言的客户端,下面一一列出来: Perl ElasticSearch.pm: Perl客户端 Python pyes: Python客户端pyelasticsearch ...

  3. nutch 1.7 导入 eclipse

    开发环境建议:ubuntu+eclipse (windows + cygwin + eclipse不推荐) 第一步:下载http://archive.apache.org/dist/nutch/从上述 ...

  4. 玩转C++运算符重载

    运算符重载语法:返回值类型  operator运算符(参数列表) {  代码逻辑... } C++中的运算符重载是通过函数来实现的,可以将重载的运算符看作是类成的一个成员函数,向普通函数一样调用.如重 ...

  5. Hadoop 学习笔记 (十) hadoop2.2.0 生产环境部署 HDFS HA Federation 含Yarn部署

    其他的配置跟HDFS-HA部署方式完全一样.但JournalNOde的配置不一样>hadoop-cluster1中的nn1和nn2和hadoop-cluster2中的nn3和nn4可以公用同样的 ...

  6. 【POI2003/2004 stage I】

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

  7. 基于android的Socket通信

    一.Socket通信简介 Android与服务器的通信方式主要有两种,一是Http通信,一是Socket通信.两者的最大差异在于,http连接使用的是“请求—响应方式”,即在请求时建立连接通道,当客户 ...

  8. 误导人的接口(interface)

    接口,interface,这个词语有误导之嫌.窃以为,这也是其名称与实际开发不符,造成难于直观理解和使用过程中产生困惑的根源.所谓名不正则言不顺:不怕生错命,最怕改坏名. 在现实生活中,接口通常是指将 ...

  9. 【HDOJ】1385 Minimum Transport Cost

    Floyd.注意字典序!!! #include <stdio.h> #include <string.h> #define MAXNUM 55 #define INF 0x1f ...

  10. 【转】Xcode 7 真机调试详细步骤

    原文网址:http://www.jianshu.com/p/fa5f90b61ad6 文/ldjhust(简书作者)原文链接:http://www.jianshu.com/p/fa5f90b61ad6 ...