.NET2.0 WinForms系列(一)实现窗体切分
2007-11-26 15:53
507 查看
use
System.Windows.Forms.SplitContainer MySplitContainer = new System.Windows.Forms.SplitContainer();
initialize
1 this.SuspendLayout();
2
3 splitContainer1.SuspendLayout();
4
5 splitContainer1.BorderStyle = BorderStyle.Fixed3D;
6
7 splitContainer1.SplitterIncrement = 7;
8
9 SplitContainer horizontalSplitter = new SplitContainer();
10 horizontalSplitter.Name = "horizontal";
11 horizontalSplitter.Orientation = Orientation.Horizontal;
12 horizontalSplitter.SuspendLayout();
13 horizontalSplitter.BorderStyle = BorderStyle.FixedSingle;
14
15
16 splitContainer1.Dock = DockStyle.Fill;
17
18 splitContainer1.Panel2.Controls.Add(horizontalSplitter);
19 horizontalSplitter.Dock = DockStyle.Fill;
20
21 splitContainer1.Panel1MinSize = 100;
22
23 horizontalSplitter.Panel1.Controls.Add(groupBox1);
24
25 groupBox1.Dock = DockStyle.None;
26
27 splitContainer1.ResumeLayout();
28 horizontalSplitter.ResumeLayout();
29 this.ResumeLayout();
Note
When adding several controls to a parent control, it is recommended that you call the SuspendLayout method before initializing the controls to be added. After adding the controls to the parent control, call the ResumeLayout method. This will increase the performance of applications with many controls.
System.Windows.Forms.SplitContainer MySplitContainer = new System.Windows.Forms.SplitContainer();
initialize
1 this.SuspendLayout();
2
3 splitContainer1.SuspendLayout();
4
5 splitContainer1.BorderStyle = BorderStyle.Fixed3D;
6
7 splitContainer1.SplitterIncrement = 7;
8
9 SplitContainer horizontalSplitter = new SplitContainer();
10 horizontalSplitter.Name = "horizontal";
11 horizontalSplitter.Orientation = Orientation.Horizontal;
12 horizontalSplitter.SuspendLayout();
13 horizontalSplitter.BorderStyle = BorderStyle.FixedSingle;
14
15
16 splitContainer1.Dock = DockStyle.Fill;
17
18 splitContainer1.Panel2.Controls.Add(horizontalSplitter);
19 horizontalSplitter.Dock = DockStyle.Fill;
20
21 splitContainer1.Panel1MinSize = 100;
22
23 horizontalSplitter.Panel1.Controls.Add(groupBox1);
24
25 groupBox1.Dock = DockStyle.None;
26
27 splitContainer1.ResumeLayout();
28 horizontalSplitter.ResumeLayout();
29 this.ResumeLayout();
Note
When adding several controls to a parent control, it is recommended that you call the SuspendLayout method before initializing the controls to be added. After adding the controls to the parent control, call the ResumeLayout method. This will increase the performance of applications with many controls.
相关文章推荐
- .NET2.0 WinForms 系列(二)实现 菜单 工具栏 状态栏
- .NET2.0 Base Class Library 系列(三)实现FTP
- 在.Net的WinForm开发中如何实现控件随窗体大小的改变而自动适应其改变
- 可以通过基类实现的几种功能。vs2008 .net 2.0
- C#基于.net CF 2.0实现手机抓屏幕
- [.NET领域驱动设计实战系列]专题七:DDD实践案例:引入事件驱动与中间件机制来实现后台管理功能
- [2010-09-20].NET 2.0 C#下利用ChineseLunisolarCalendar类农历的实现
- C# 继承.Net中提供的WebBrowser 2.0控件以实现IE的超级拖放
- 用SignalR 2.0开发客服系统[系列2:实现聊天室]
- 网站二级域名用.net 2.0实现方案
- 在.NET 2.0中实现友元程序集
- ASP.NET 2.0 中实现模板中的数据绑定系列
- 用SignalR 2.0开发客服系统[系列3:实现点对点通讯]
- 用SignalR 2.0开发客服系统[系列1:实现群发通讯]
- 在WinForms程序里实现窗体传值的最佳实践
- [.NET领域驱动设计实战系列]专题七:DDD实践案例:引入事件驱动与中间件机制来实现后台管理功能
- ASP.NET 2.0 中实现模板中的数据绑定系列(2)
- ASP.NET 2.0 中实现模板中的数据绑定系列
- .Net 站点在Windows环境借助Nginx和Redis实现负载均衡系列(四)
- SWT行,AWT/Swing也行系列(1)-实现半透明及不规则窗体