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下,浏览器解析渲染时,会认为空白符也是占位置的,默认其具有字 ...
随机推荐
- idea调试springmvc出现java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
idea调试springmvc出现java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderList ...
- laravel 数据验证
laravel 数据验证 在保存数据之前进行数据验证 类需要继承 Controller 然后用 $this->validate( $request , ['title' => 'requ ...
- b'driver "overlay" failed to remove root filesystem 的解决方法
1.docker-compose启的nexus仓库意外dead 公司的maven私服nexus是通过docker-compose启动的,不知道什么原因意外死掉了.再次启动的时候报错: [root@ ...
- C#基础知识回顾--委托事件
在上一篇看到他我一下子就悟了(续)---委托,被人狂喷.说写的太空,没有什么内容之类的.所以准备在这里重写下,不过还是按着以前的方式尽量简单的写.这里我们以打篮球为例. 第一步:首先,其他对象订购事件 ...
- 本地SQL数据库执行作业定时修改其他数据库内容
--exec sp_addlinkedserver 'xkp', ' ', 'SQLOLEDB', '192.168.66.66' 定义链接--exec sp_addlinkedsrvlogin ' ...
- 转载 HashSet用法
NET 3.5在System.Collections.Generic命名空间中包含一个新的集合类:HashSet<T>.这个集合类包含不重复项的无序列表.这种集合称为“集(set)”.集是 ...
- 自己写一个java的mvc框架吧(五)
自己写一个mvc框架吧(五) 给框架添加注解的支持 一段废话 上一章本来是说这一章要写视图处理的部分,但是由于我在测试代码的时候需要频繁的修改配置文件,太麻烦了.所以这一章先把支持注解的功能加上,这样 ...
- Software-Defined Networking A Comprehensive Survey --阅读_day1
The Internet has led to the creation of a digital society, where (almost) everything is connected an ...
- JS 正则截取字符串
1.js截取两个字符串之间的内容: varstr = "aaabbbcccdddeeefff"; str = str.match(/aaa(\S*)fff/)[1]; alert( ...
- tar.xz文件的解压
xz是绝大数linux默认就带的一个压缩工具. 压缩包xz格式的居然比7z还要小. 不过xz也有一个坏处就是压缩时间比较长,比7z压缩时间还长一些.不过压缩是一次性的,所以可以忽略. xz压缩文件方法 ...