DevExpress12、DocumentManager
DocumentManager控件
你用过Photoshop吗?里面每打开一个照片,就有一个小窗体承载这个照片,你可以在这些小窗体间切换,最小化、最大化、排列窗体,
这些操作都在Photoshop的大框架(MDI主窗体)里,而这些小窗体就是MDI子窗体。
MDI是Multiple Document Interface的缩写,就是多文档界面的意思。它是和单文档SDI相对的。
MDI和SDI在界面上的主要区别如下:MDI允许用户同时打开多个文档,而SDI只能打开一个文档。
MDI子窗体可以通过DocumentManger控件,以 nativemdiview 对象或 tabbedview 对象的形式展现出来;
通过其 ViewCollection属性 添加View视图(子窗体),可以添加TabbedView、WindowsUIView、WidgetView、NativeMdiView四种视图;
通过Run Designer中Main下的Document给视图添加Document文档(显示的面板);
NativeMdiView视图
实现效果如图:
通过代码实现如下:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DevExpress.XtraBars.Docking2010;
using DevExpress.XtraBars.Docking2010.Views.NativeMdi; namespace DXApplication_1
{
public partial class DocumentMangerForm : DevExpress.XtraEditors.XtraForm
{
public DocumentMangerForm()
{
InitializeComponent();
} private void DocumentMangerForm_Load(object sender, EventArgs e)
{
Encapsulation_CreateDocumentManager();
for (int i = ; i < ; i++) {
Encapsulation_AddChild();
}
} void Encapsulation_CreateDocumentManager() {
DocumentManager documentManager = new DocumentManager();
documentManager.MdiParent = this;
// type one
documentManager.View = new NativeMdiView();
} int childCount = ;
void Encapsulation_AddChild() {
Form childForm = new Form();
childForm.Text = "Child Form " + (++childCount); SimpleButton btn = new SimpleButton();
btn.Text = "Button " + childCount;
btn.Parent = childForm; //
childForm.MdiParent = this;
childForm.Show();
}
}
}
TabbedView视图
实现效果如图:
代码实现如下:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DevExpress.XtraBars.Docking2010;
using DevExpress.XtraBars.Docking2010.Views.Tabbed; namespace DXApplication_1
{
public partial class DocumentMangerForm2 : DevExpress.XtraEditors.XtraForm
{
public DocumentMangerForm2()
{
InitializeComponent();
} private void DocumentMangerForm2_Load(object sender, EventArgs e)
{
Encapsulation_CreateDocumentManager();
for (int i = ; i < ; i++)
{
Encapsulation_AddChild();
}
} void Encapsulation_CreateDocumentManager()
{
DocumentManager documentManager = new DocumentManager();
documentManager.MdiParent = this;
// another type
documentManager.View = new TabbedView();
} int childCount = ;
void Encapsulation_AddChild()
{
Form childForm = new Form();
childForm.Text = "Child Form " + (++childCount); SimpleButton btn = new SimpleButton();
btn.Text = "Button " + childCount;
btn.Parent = childForm; //
childForm.MdiParent = this;
childForm.Show();
}
}
}
DevExpress12、DocumentManager的更多相关文章
- 黑马-Spring(IOC&DI) AOP
IOC(控制翻转) 概念 把对象的创建.初始化.销毁等工作交给spring容器来做 案例 环境 步骤 1. 写一个HelloWorld类 2. 写一个配置文件 把hello类放到spring容 ...
- DevExpress12.2.4 GridControl相关技巧
1.DevExpress12.2.4中,设置GridControl的GridView为可编辑方法如下: gvMainControl.OptionsBehavior.Editable = true; 2 ...
- Spring自学教程-IOC、DI、AOP(二)
一.spring的IOC-就是怎样使用spring来创建对象 二.springDI(依赖注入)-就是怎样给属性赋值 通过set方式赋值 以下我们只需要记住两点的赋值,基本类型和引用类型的赋值 基本类型 ...
- C#操作CAD-初始化、引用dll
操作cad等方式有很多,比如C,C++,vb.lisp(效率最高,但是语言结构性太差)和C#,因为我等个人习惯和方便等原因,在此讲解一下用C#操作流程,后续会更新操作图层.扩展数据.绘图等操作步骤.当 ...
- Spring学习笔记之基础、IOC、DI(1)
0.0 Spring基本特性 Spring是一个开源框架:是基于Core来架构多层JavaEE系统 1.0 IOC 控制反转:把对象的创建过程交给spring容器来做. 1.1 application ...
- js-静态、原型、实例属性
本篇来说一下js中的属性: 1.静态属性 2.原型属性 3.实例属性 静态属性: function klass(){} var obj=new klass(); klass.count=0; klas ...
- 【.net 深呼吸】细说CodeDom(2):表达式、语句
在上一篇文章中,老周厚着脸皮给大伙介绍了代码文档的基本结构,以及一些代码对象与CodeDom类型的对应关系. 在评论中老周看到有朋友提到了 Emit,那老周就顺便提一下.严格上说,Emit并不是针对代 ...
- javascript中的Array对象 —— 数组的合并、转换、迭代、排序、堆栈
Array 是javascript中经常用到的数据类型.javascript 的数组其他语言中数组的最大的区别是其每个数组项都可以保存任何类型的数据.本文主要讨论javascript中数组的声明.转换 ...
- IE6、7下html标签间存在空白符,导致渲染后占用多余空白位置的原因及解决方法
直接上图:原因:该div包含的内容是靠后台进行print操作,输出的.如果没有输出任何内容,浏览器会默认给该空白区域添加空白符.在IE6.7下,浏览器解析渲染时,会认为空白符也是占位置的,默认其具有字 ...
随机推荐
- Docker基础教程(常用命令篇)
1.查看docker信息 # 查看docker版本 $docker version # 显示docker系统的信息 $docker info 2.启动容器 # 交互式 $docker run -it ...
- [JSOI 2007]字符加密Cipher
Description 题库链接 给你一个长度为 \(n\) 的字符串,首尾相接依次断开每个断点可以得到 \(n\) 个长度为 \(n\) 的字符串,将其排序按序输出每个字符串的最后一个字母. \(1 ...
- 用ECMAScript4 ( ActionScript3) 实现Unity的热更新 -- 热更新Live2D
live2D是一个很强大的2D动画组件.我们可以使用AS3脚本对它进行热更新. live2D在Unity中的使用请看这里: 如何获取Live2D 总得来说,我们可以先去live2D官网下载它的Unit ...
- [Angularjs]cookie操作
摘要 现在很多app采用内嵌h5的方式进行开发,有些数据会存在webveiw的cookie中,那么如果使用angularjs开发单页应用,就需要用到angularjs的cookie操作.这里提供一个简 ...
- python学习之内存机制
不可变对象(字符串.元组) 1. a = 1 首先在内存中创建对象1,并记录对象的引用计数为1次. id(a) 查看变量a引用的对象的内存地址 2. b = 1 内存中已存在对象1,变量b引用对象1, ...
- 【MongoDB-query查询条件】
在上一篇中简要使用了C# 对MongoDB进行数据操作,这里补充一些MongoDB query查询条件文档: Query.All("name", "a",&qu ...
- asp.net错误记录
//登录 jquery-ajax post请求后台无法获取数据,get就可以!!!原因:get方法,后台接收用Request.QueryString["para1"];post方法 ...
- [转载]常用 SQL Server 规范集锦
转载者注:据说是某公司(携程)内部规范. 常见的字段类型选择 1.字符类型建议采用varchar/nvarchar数据类型 2.金额货币建议采用money数据类型 3.科学计数建议采用numeric数 ...
- 【JVM】3、JVM问题查找
1.查看tomcat进程号 两种方式都可以查看tomcat进程号 ps -ef | grep tomcat-web jps -lmvV |grep tomcat-web 结果如下:2556 2.查看进 ...
- 使用json-org包实现POJO和json的转换
使用json-org包实现POJO和json的转换 这个jar包把对象转换成json超级舒服,所以顺便记录一下吧 把单个pojo对象转换成json对象 Student student = new St ...