设为首页  
联系我们  
加入收藏  
网页制作 冲浪宝典 图形图像 操作系统 软件教学 编程开发 认证考试 安全技术 站长专区 文学驿站 娱乐天地 游戏天地 办公软件
文章搜索
您的位置: 首页 >> 文章首页 >> 编程开发 >> 网络编程 >> .net >> Win Form 的 Splitter 使用心得
精品推荐
.net点击TOP10
·我的.NET书架 (入门篇)
·.NET:是什么?将走向哪里?
·.NET 初 级 读 本
·在ASP.NET中把图片保存到SQL SERVER数据库
·从零开始学ASP.NET(基础篇)
·DataGrid导成Excel的例子
·ASP.Net Web Page深入探讨(一)
·CHK文件恢复工具
·.NET编程规范
·.NET Petshop详解(三):petshop三层结构之MiddleTire
网络编程点击TOP10
·ASP.NET 程序中常用的三十三种代码
·利用ASP.NET构建网上考试系统
·C#版的网站新闻发布系统
·设计ASP.NET新闻管理系统
·我的.NET书架 (入门篇)
·用ASP.NET和XML做的新闻系统
·.NET:是什么?将走向哪里?
·.NET 初 级 读 本
·十天学会ASP.net之第一天
·用C#实现木马程序
精选专题

Win Form 的 Splitter 使用心得

作者: 来源:网络文章 时间:2005-12-13 21:05:51

Win Form 的 Splitter 使用心得(1)

 

Win Form 的 Splitter 使用心得

    今天作个分析html代码,然后再批量下载的程序,其中用到 Splitter (分割条),编译程序后,发现分割条不起作用,拖动分割条的时候,相邻的两个 Panel 没有变换大小。为这个几乎花了一天时间,也没找到原因。包括到其他机子上测试。

    后来,再次作一个完全独立的测试项目,发现 Splitter 的使用有个算是 bug 的问题,如果你首先放两个 Panel ,然后再放一个 Splitter 。(注意这时候的次序)就会产生我上面出现的问题。这时候代码中的 InitializeComponent 函数部分代码如下:

private void InitializeComponent(){//// ... 其他代码//this.panel1 = new System.Windows.Forms.Panel();this.panel2 = new System.Windows.Forms.Panel();this.splitter1 = new System.Windows.Forms.Splitter();this.panel2.SuspendLayout();this.SuspendLayout();//// ... 其他代码//// // panel1// this.panel1.Dock = System.Windows.Forms.DockStyle.Left;this.panel1.Location = new System.Drawing.Point(0, 42);this.panel1.Name = "panel1";this.panel1.Size = new System.Drawing.Size(120, 209);this.panel1.TabIndex = 6;this.panel1.Resize += new System.EventHandler(this.panel2_Resize);this.panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.panel2_Paint);// // panel2// this.panel2.Controls.Add(this.splitter1);this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;this.panel2.Location = new System.Drawing.Point(120, 42);this.panel2.Name = "panel2";this.panel2.Size = new System.Drawing.Size(328, 209);this.panel2.TabIndex = 7;this.panel2.Resize += new System.EventHandler(this.panel2_Resize);this.panel2.Paint += new System.Windows.Forms.PaintEventHandler(this.panel2_Paint);// // splitter1// this.splitter1.BackColor = System.Drawing.SystemColors.Desktop;this.splitter1.Location = new System.Drawing.Point(0, 0);this.splitter1.Name = "splitter1";this.splitter1.Size = new System.Drawing.Size(3, 209);this.splitter1.TabIndex = 0;this.splitter1.TabStop = false;// // Form1// this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);this.ClientSize = new System.Drawing.Size(448, 273);this.Controls.Add(this.panel2);this.Controls.Add(this.panel1);this.Controls.Add(this.toolBar1);this.Controls.Add(this.statusBar1);this.Name = "Form1";this.Text = "站点下载工具 2003年9月21日";this.panel2.ResumeLayout(false);this.ResumeLayout(false);}

注意:这时候的代码中的顺序。这时候,程序的执行是有问题的。分隔条会不起作用。

但是如果你把这三个控件放入顺序修改为下面的顺序就没有问题了。

共3页 9 7 [1] [2] [38 :>

Win Form 的 Splitter 使用心得 相关文章:
Win Form 的 Splitter 使用心得 相关软件:
特别声明:本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系编辑人员,我们尽快予以更正。
转载请注明来源:http://www.xgdown.com