using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace Test
{
	/// <summary>
	/// Form2 的摘要说明。
	/// </summary>
	public class Form2 : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.Label label4;
		private System.Windows.Forms.Label label5;
		private System.Windows.Forms.Label label6;
		private System.Windows.Forms.Label label7;
		private System.Windows.Forms.Label label8;
		private System.Windows.Forms.Label label9;
		private System.Windows.Forms.Label label10;
		private System.Windows.Forms.Label label11;
   
     private int MouseX;
		private int MouseY;
		private System.Windows.Forms.Label label12;
		private System.Windows.Forms.Label label13;
		private System.Windows.Forms.Label label14;
		private System.Windows.Forms.Label label15;
		private System.Windows.Forms.Label label16;
		private System.Windows.Forms.Button button5;
		private System.Windows.Forms.Button button9;
		private System.Windows.Forms.Button button10;
		private System.Windows.Forms.Button button11;
		private System.Windows.Forms.VScrollBar vScrollBar1;
		private System.Windows.Forms.HScrollBar hScrollBar1;
		private System.Windows.Forms.Panel panel2;
		private System.Windows.Forms.Button button8;
		private System.Windows.Forms.Button button7;
		private System.Windows.Forms.Button button6;
		private System.Windows.Forms.Button button4;
		private System.Windows.Forms.Button button3;
		private System.Windows.Forms.Button button2;
		private System.Windows.Forms.Button button1;
		private System.Windows.Forms.ListBox listBox1;
		private System.Windows.Forms.ListBox listBox2;
		private System.Windows.Forms.ListBox listBox3;
		private System.Windows.Forms.ListBox listBox4;

		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		private System.ComponentModel.Container components = null;

		public Form2()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
		}

		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows 窗体设计器生成的代码
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			this.label1 = new System.Windows.Forms.Label();
			this.label2 = new System.Windows.Forms.Label();
			this.label3 = new System.Windows.Forms.Label();
			this.label4 = new System.Windows.Forms.Label();
			this.label5 = new System.Windows.Forms.Label();
			this.label6 = new System.Windows.Forms.Label();
			this.label7 = new System.Windows.Forms.Label();
			this.label8 = new System.Windows.Forms.Label();
			this.label9 = new System.Windows.Forms.Label();
			this.label10 = new System.Windows.Forms.Label();
			this.label11 = new System.Windows.Forms.Label();
			this.label12 = new System.Windows.Forms.Label();
			this.label13 = new System.Windows.Forms.Label();
			this.label14 = new System.Windows.Forms.Label();
			this.label15 = new System.Windows.Forms.Label();
			this.label16 = new System.Windows.Forms.Label();
			this.button5 = new System.Windows.Forms.Button();
			this.button9 = new System.Windows.Forms.Button();
			this.button10 = new System.Windows.Forms.Button();
			this.button11 = new System.Windows.Forms.Button();
			this.vScrollBar1 = new System.Windows.Forms.VScrollBar();
			this.hScrollBar1 = new System.Windows.Forms.HScrollBar();
			this.panel2 = new System.Windows.Forms.Panel();
			this.button8 = new System.Windows.Forms.Button();
			this.button7 = new System.Windows.Forms.Button();
			this.button6 = new System.Windows.Forms.Button();
			this.button4 = new System.Windows.Forms.Button();
			this.button3 = new System.Windows.Forms.Button();
			this.button2 = new System.Windows.Forms.Button();
			this.button1 = new System.Windows.Forms.Button();
			this.listBox1 = new System.Windows.Forms.ListBox();
			this.listBox2 = new System.Windows.Forms.ListBox();
			this.listBox3 = new System.Windows.Forms.ListBox();
			this.listBox4 = new System.Windows.Forms.ListBox();
			this.panel2.SuspendLayout();
			this.SuspendLayout();
			// 
			// label1
			// 
			this.label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.label1.Location = new System.Drawing.Point(2, 2);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(54, 18);
			this.label1.TabIndex = 0;
			this.label1.Text = "label1";
			this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label2
			// 
			this.label2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.label2.Location = new System.Drawing.Point(54, 2);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(106, 34);
			this.label2.TabIndex = 1;
			this.label2.Text = "label2";
			this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label3
			// 
			this.label3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.label3.Location = new System.Drawing.Point(158, 2);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(166, 18);
			this.label3.TabIndex = 2;
			this.label3.Text = "label3";
			this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label4
			// 
			this.label4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.label4.Location = new System.Drawing.Point(242, 2);
			this.label4.Name = "label4";
			this.label4.Size = new System.Drawing.Size(84, 18);
			this.label4.TabIndex = 3;
			this.label4.Text = "label4";
			this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// label5
			// 
			this.label5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.label5.Location = new System.Drawing.Point(324, 2);
			this.label5.Name = "label5";
			this.label5.Size = new System.Drawing.Size(86, 18);
			this.label5.TabIndex = 4;
			this.label5.Text = "label5";
			this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			this.label5.MouseMove += new System.Windows.Forms.MouseEventHandler(this.label5_MouseMove);
			// 
			// label6
			// 
			this.label6.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.label6.Location = new System.Drawing.Point(408, 2);
			this.label6.Name = "label6";
			this.label6.Size = new System.Drawing.Size(78, 18);
			this.label6.TabIndex = 5;
			this.label6.Text = "label6";
			this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label7
			// 
			this.label7.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.label7.Location = new System.Drawing.Point(2, 18);
			this.label7.Name = "label7";
			this.label7.Size = new System.Drawing.Size(54, 18);
			this.label7.TabIndex = 6;
			this.label7.Text = "label7";
			this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label8
			// 
			this.label8.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.label8.Location = new System.Drawing.Point(240, 18);
			this.label8.Name = "label8";
			this.label8.Size = new System.Drawing.Size(84, 20);
			this.label8.TabIndex = 7;
			this.label8.Text = "label8";
			this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label9
			// 
			this.label9.BackColor = System.Drawing.Color.Transparent;
			this.label9.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.label9.Cursor = System.Windows.Forms.Cursors.VSplit;
			this.label9.Location = new System.Drawing.Point(324, 4);
			this.label9.Name = "label9";
			this.label9.Size = new System.Drawing.Size(2, 40);
			this.label9.TabIndex = 12;
			this.label9.Text = "label9";
			// 
			// label10
			// 
			this.label10.BackColor = System.Drawing.Color.Black;
			this.label10.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.label10.Cursor = System.Windows.Forms.Cursors.VSplit;
			this.label10.Location = new System.Drawing.Point(242, 2);
			this.label10.Name = "label10";
			this.label10.Size = new System.Drawing.Size(2, 40);
			this.label10.TabIndex = 13;
			this.label10.Text = "label10";
			// 
			// label11
			// 
			this.label11.BackColor = System.Drawing.Color.Transparent;
			this.label11.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.label11.Cursor = System.Windows.Forms.Cursors.SizeWE;
			this.label11.Location = new System.Drawing.Point(552, 12);
			this.label11.Name = "label11";
			this.label11.Size = new System.Drawing.Size(2, 40);
			this.label11.TabIndex = 14;
			this.label11.Text = "label11";
			this.label11.Click += new System.EventHandler(this.label11_Click);
			this.label11.MouseUp += new System.Windows.Forms.MouseEventHandler(this.label11_MouseUp);
			this.label11.MouseMove += new System.Windows.Forms.MouseEventHandler(this.label11_MouseMove);
			this.label11.MouseDown += new System.Windows.Forms.MouseEventHandler(this.label11_MouseDown);
			// 
			// label12
			// 
			this.label12.BackColor = System.Drawing.Color.Transparent;
			this.label12.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.label12.Cursor = System.Windows.Forms.Cursors.VSplit;
			this.label12.Location = new System.Drawing.Point(158, 2);
			this.label12.Name = "label12";
			this.label12.Size = new System.Drawing.Size(2, 40);
			this.label12.TabIndex = 15;
			this.label12.Text = "label12";
			// 
			// label13
			// 
			this.label13.BackColor = System.Drawing.Color.Transparent;
			this.label13.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.label13.Cursor = System.Windows.Forms.Cursors.VSplit;
			this.label13.Location = new System.Drawing.Point(54, 2);
			this.label13.Name = "label13";
			this.label13.Size = new System.Drawing.Size(2, 40);
			this.label13.TabIndex = 16;
			this.label13.Text = "label13";
			// 
			// label14
			// 
			this.label14.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.label14.Location = new System.Drawing.Point(410, 18);
			this.label14.Name = "label14";
			this.label14.Size = new System.Drawing.Size(78, 20);
			this.label14.TabIndex = 17;
			this.label14.Text = "label14";
			this.label14.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label15
			// 
			this.label15.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.label15.Location = new System.Drawing.Point(160, 18);
			this.label15.Name = "label15";
			this.label15.Size = new System.Drawing.Size(84, 18);
			this.label15.TabIndex = 18;
			this.label15.Text = "label15";
			this.label15.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label16
			// 
			this.label16.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.label16.Location = new System.Drawing.Point(326, 20);
			this.label16.Name = "label16";
			this.label16.Size = new System.Drawing.Size(82, 20);
			this.label16.TabIndex = 19;
			this.label16.Text = "label16";
			this.label16.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// button5
			// 
			this.button5.Location = new System.Drawing.Point(8, 176);
			this.button5.Name = "button5";
			this.button5.Size = new System.Drawing.Size(102, 22);
			this.button5.TabIndex = 24;
			this.button5.Text = "button5";
			// 
			// button9
			// 
			this.button9.Location = new System.Drawing.Point(8, 110);
			this.button9.Name = "button9";
			this.button9.Size = new System.Drawing.Size(102, 22);
			this.button9.TabIndex = 28;
			this.button9.Text = "button9";
			// 
			// button10
			// 
			this.button10.Location = new System.Drawing.Point(8, 132);
			this.button10.Name = "button10";
			this.button10.Size = new System.Drawing.Size(102, 22);
			this.button10.TabIndex = 29;
			this.button10.Text = "button10";
			// 
			// button11
			// 
			this.button11.Location = new System.Drawing.Point(8, 154);
			this.button11.Name = "button11";
			this.button11.Size = new System.Drawing.Size(102, 22);
			this.button11.TabIndex = 30;
			this.button11.Text = "button11";
			// 
			// vScrollBar1
			// 
			this.vScrollBar1.Location = new System.Drawing.Point(514, 58);
			this.vScrollBar1.Name = "vScrollBar1";
			this.vScrollBar1.Size = new System.Drawing.Size(18, 308);
			this.vScrollBar1.TabIndex = 31;
			// 
			// hScrollBar1
			// 
			this.hScrollBar1.Location = new System.Drawing.Point(2, 366);
			this.hScrollBar1.Name = "hScrollBar1";
			this.hScrollBar1.Size = new System.Drawing.Size(514, 18);
			this.hScrollBar1.TabIndex = 32;
			// 
			// panel2
			// 
			this.panel2.Controls.Add(this.button8);
			this.panel2.Controls.Add(this.button7);
			this.panel2.Controls.Add(this.button6);
			this.panel2.Controls.Add(this.button4);
			this.panel2.Controls.Add(this.button3);
			this.panel2.Controls.Add(this.button2);
			this.panel2.Controls.Add(this.button1);
			this.panel2.Location = new System.Drawing.Point(8, 48);
			this.panel2.Name = "panel2";
			this.panel2.Size = new System.Drawing.Size(506, 58);
			this.panel2.TabIndex = 34;
			// 
			// button8
			// 
			this.button8.Location = new System.Drawing.Point(408, 29);
			this.button8.Name = "button8";
			this.button8.Size = new System.Drawing.Size(98, 22);
			this.button8.TabIndex = 34;
			this.button8.Text = "button8";
			// 
			// button7
			// 
			this.button7.Location = new System.Drawing.Point(204, 29);
			this.button7.Name = "button7";
			this.button7.Size = new System.Drawing.Size(102, 22);
			this.button7.TabIndex = 33;
			this.button7.Text = "button7";
			// 
			// button6
			// 
			this.button6.Location = new System.Drawing.Point(102, 29);
			this.button6.Name = "button6";
			this.button6.Size = new System.Drawing.Size(102, 22);
			this.button6.TabIndex = 32;
			this.button6.Text = "button6";
			// 
			// button4
			// 
			this.button4.Location = new System.Drawing.Point(306, 7);
			this.button4.Name = "button4";
			this.button4.Size = new System.Drawing.Size(102, 44);
			this.button4.TabIndex = 31;
			this.button4.Text = "button4";
			// 
			// button3
			// 
			this.button3.Location = new System.Drawing.Point(102, 7);
			this.button3.Name = "button3";
			this.button3.Size = new System.Drawing.Size(204, 22);
			this.button3.TabIndex = 30;
			this.button3.Text = "button3";
			// 
			// button2
			// 
			this.button2.Location = new System.Drawing.Point(408, 7);
			this.button2.Name = "button2";
			this.button2.Size = new System.Drawing.Size(98, 22);
			this.button2.TabIndex = 29;
			this.button2.Text = "button2";
			// 
			// button1
			// 
			this.button1.Location = new System.Drawing.Point(0, 7);
			this.button1.Name = "button1";
			this.button1.Size = new System.Drawing.Size(102, 44);
			this.button1.TabIndex = 28;
			this.button1.Text = "button1";
			// 
			// listBox1
			// 
			this.listBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.listBox1.ItemHeight = 12;
			this.listBox1.Location = new System.Drawing.Point(112, 100);
			this.listBox1.Name = "listBox1";
			this.listBox1.Size = new System.Drawing.Size(100, 266);
			this.listBox1.TabIndex = 35;
			// 
			// listBox2
			// 
			this.listBox2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.listBox2.ItemHeight = 12;
			this.listBox2.Location = new System.Drawing.Point(210, 100);
			this.listBox2.Name = "listBox2";
			this.listBox2.Size = new System.Drawing.Size(108, 266);
			this.listBox2.TabIndex = 36;
			// 
			// listBox3
			// 
			this.listBox3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.listBox3.ItemHeight = 12;
			this.listBox3.Location = new System.Drawing.Point(316, 100);
			this.listBox3.Name = "listBox3";
			this.listBox3.Size = new System.Drawing.Size(98, 266);
			this.listBox3.TabIndex = 37;
			// 
			// listBox4
			// 
			this.listBox4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.listBox4.ItemHeight = 12;
			this.listBox4.Location = new System.Drawing.Point(412, 100);
			this.listBox4.Name = "listBox4";
			this.listBox4.Size = new System.Drawing.Size(100, 266);
			this.listBox4.TabIndex = 38;
			// 
			// Form2
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.AutoScroll = true;
			this.ClientSize = new System.Drawing.Size(660, 405);
			this.Controls.Add(this.listBox4);
			this.Controls.Add(this.listBox3);
			this.Controls.Add(this.listBox2);
			this.Controls.Add(this.listBox1);
			this.Controls.Add(this.panel2);
			this.Controls.Add(this.hScrollBar1);
			this.Controls.Add(this.vScrollBar1);
			this.Controls.Add(this.button11);
			this.Controls.Add(this.button10);
			this.Controls.Add(this.button9);
			this.Controls.Add(this.button5);
			this.Controls.Add(this.label16);
			this.Controls.Add(this.label3);
			this.Controls.Add(this.label10);
			this.Controls.Add(this.label15);
			this.Controls.Add(this.label14);
			this.Controls.Add(this.label12);
			this.Controls.Add(this.label13);
			this.Controls.Add(this.label11);
			this.Controls.Add(this.label9);
			this.Controls.Add(this.label1);
			this.Controls.Add(this.label2);
			this.Controls.Add(this.label4);
			this.Controls.Add(this.label5);
			this.Controls.Add(this.label6);
			this.Controls.Add(this.label7);
			this.Controls.Add(this.label8);
			this.Name = "Form2";
			this.Text = "Form2";
			this.Load += new System.EventHandler(this.Form2_Load);
			this.panel2.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion
		public void DrawLinesPointF(PaintEventArgs e)
		{
			// Create pen.
			Pen pen = new Pen(Color.Black, 3);
			// Create array of points that define lines to draw.
			PointF[] points =
			{
				new PointF( 10.0F,  10.0F),
				new PointF( 10.0F, 100.0F),
				new PointF(200.0F,  50.0F),
				new PointF(250.0F, 300.0F)
			};
			//Draw lines to screen.
			e.Graphics.DrawLines(pen, points);
		}

		private void label11_Click(object sender, System.EventArgs e)
		{
		
		}

		private void label11_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
		{
			MouseX=e.X ;
			MouseY=e.Y ;
		}

		private void label11_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
		{
		
//label11.Left=e.X;
		}

		private void label11_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
		{
			label5.Width +=e.X-MouseX+1;
			label6.Left =label5.Width+label5.Left;
			label11.Left=label6.Left-1 ;
		}

		private void label5_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
		{
			if (e.X>label5.Left +label5.Width-5 )
			{
				this.label5.Cursor = System.Windows.Forms.Cursors.SizeWE;
			}
			else
			{
				this.label5.Cursor = System.Windows.Forms.Cursors.Default;
			}
		}

		private void Form2_Load(object sender, System.EventArgs e)
		{
		
		}
	}
}
