资讯   |   开发   |   选机中心   |   产品大全 | IBM | 惠普 | 联想 | 戴尔 | 苹果 | 神舟
更多: | 华硕 | 明基 | 方正 | 紫光 | TCL | 夏新 | 联宝 | 宏碁 | 七喜 | 长城 | 清华同方 | 海尔 | 三星 | 东芝 | 索尼 | 富士通 | LG | 技术 | ddnoon
当前位置:笔记本 > 软件开发 >
Advertisement
文章正文

请问高手:怎样实现窗体内的上下两部分进行拖动?

类型:转载   责任编辑:asp.net   日期:2007/05/23


热门软件下载:


   

就如本论坛内的导航栏和论坛区之间有个分割panel,拉动这个panel,实现这两部分移动?

网友回答:

发表者:tenglong2004

splitter控件

发表者:YanZhen

splitter控件安装后即可

发表者:greatProject

using   System;  
  using   System.Drawing;  
  using   System.Collections;  
  using   System.ComponentModel;  
  using   System.Windows.Forms;  
  using   System.Data;  
   
  namespace   WindowsApplication22  
  {  
  ///   <summary>  
  ///   Summary   description   for   Form1.  
  ///   </summary>  
  public   class   Form1   :   System.Windows.Forms.Form  
  {  
  private   System.Windows.Forms.Panel   panel1;  
  private   System.Windows.Forms.Panel   panel2;  
  private   System.Windows.Forms.Splitter   splitter1;  
  ///   <summary>  
  ///   Required   designer   variable.  
  ///   </summary>  
  private   System.ComponentModel.Container   components   =   null;  
   
  public   Form1()  
  {  
  //  
  //   Required   for   Windows   Form   Designer   support  
  //  
  InitializeComponent();  
   
  //  
  //   TODO:   Add   any   constructor   code   after   InitializeComponent   call  
  //  
  }  
   
  ///   <summary>  
  ///   Clean   up   any   resources   being   used.  
  ///   </summary>  
  protected   override   void   Dispose(   bool   disposing   )  
  {  
  if(   disposing   )  
  {  
  if   (components   !=   null)    
  {  
  components.Dispose();  
  }  
  }  
  base.Dispose(   disposing   );  
  }  
   
  #region   Windows   Form   Designer   generated   code  
  ///   <summary>  
  ///   Required   method   for   Designer   support   -   do   not   modify  
  ///   the   contents   of   this   method   with   the   code   editor.  
  ///   </summary>  
  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.SuspendLayout();  
  //    
  //   panel1  
  //    
  this.panel1.BackColor   =   System.Drawing.Color.IndianRed;  
  this.panel1.Dock   =   System.Windows.Forms.DockStyle.;  
  this.panel1.Location   =   new   System.Drawing.Point(0,   0);  
  this.panel1.Name   =   "panel1";  
  this.panel1.Size   =   new   System.Drawing.Size(292,   88);  
  this.panel1.TabIndex   =   0;  
  //    
  //   panel2  
  //    
  this.panel2.BackColor   =   System.Drawing.Color.Lime;  
  this.panel2.Dock   =   System.Windows.Forms.DockStyle.Fill;  
  this.panel2.Location   =   new   System.Drawing.Point(0,   88);  
  this.panel2.Name   =   "panel2";  
  this.panel2.Size   =   new   System.Drawing.Size(292,   185);  
  this.panel2.TabIndex   =   2;  
  this.panel2.Paint   +=   new   System.Windows.Forms.PaintEventHandler(this.panel2_Paint);  
  //    
  //   splitter1  
  //    
  this.splitter1.BackColor   =   System.Drawing.SystemColors.ActiveCaption;  
  this.splitter1.Dock   =   System.Windows.Forms.DockStyle.;  
  this.splitter1.Location   =   new   System.Drawing.Point(0,   88);  
  this.splitter1.Name   =   "splitter1";  
  this.splitter1.Size   =   new   System.Drawing.Size(292,   24);  
  this.splitter1.TabIndex   =   3;  
  this.splitter1.TabStop   =   false;  
  //    
  //   Form1  
  //    
  this.AutoScaleBaseSize   =   new   System.Drawing.Size(5,   13);  
  this.ClientSize   =   new   System.Drawing.Size(292,   273);  
  this.Controls.Add(this.splitter1);  
  this.Controls.Add(this.panel2);  
  this.Controls.Add(this.panel1);  
  this.Name   =   "Form1";  
  this.Text   =   "Form1";  
  this.ResumeLayout(false);  
   
  }  
  #endregion  
   
  ///   <summary>  
  ///   The   main   entry   point   for   the   application.  
  ///   </summary>  
  [STAThread]  
  static   void   Main()    
  {  
  Application.Run(new   Form1());  
  }  
   
  private   void   panel2_Paint(object   sender,   System.Windows.Forms.PaintEventArgs   e)  
  {  
   
  }  
  }  
  }  
 

发表者:tiger200000000

◎-◎楼上的怎么Windows.Forms都来了,建议脚本

发表者:happyjun2000

顶,接点分^_^  
  无聊就接分来了

发表者:hanbinghai

设置spliter控件的dock属性


 

 
热门推荐笔记本: IBM笔记本
相关文章:
笔记本相关:
IT技术文章:
webmaster:popbb@126.com   最佳浏览:1024X768 MSIE
©2007 popbb.net All Rights Reserved