亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? usercontrol1.cs

?? 用C#自己封的一個時間類庫
?? CS
字號:
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;

namespace WindowsExtendedControls
{
	/// <summary>
	/// 控件
	/// </summary>
	public class ShapeEx : System.Windows.Forms.Control
	{
		/// <summary>
		/// 必需的設計器變量。
		/// </summary>
		/// 
		private Color _BorderColor=new Color();
		private Color _BackColor=new Color();
		private bool _ReSizeble;
		private Point _SelfLocation=new Point();
		private Point _MouseLocation=new Point();
		private int _SelfWidth;
		private int _SelfHeight;
		private int _SelectSelctedIndex;//0-8,0:SizeAll
		private Rectangle _rectLeftSelector=new Rectangle();
		private Rectangle _rectTopSelector=new Rectangle();
		private Rectangle _rectRightSelector=new Rectangle();
		private Rectangle _rectBottomSelector=new Rectangle();
		private Rectangle _rectLeftTopSelector=new Rectangle();
		private Rectangle _rectRightTopSelector=new Rectangle();
		private Rectangle _rectRightBottomSelector=new Rectangle();
		private Rectangle _rectLeftBottomSelector=new Rectangle();
		private System.Windows.Forms.DataGrid dataGrid1;
		private System.Windows.Forms.DataGrid dataGrid2;
		private System.ComponentModel.Container components = null;
		public ShapeEx()
		{
			// 該調用是 Windows.Forms 窗體設計器所必需的。
			InitializeComponent();

			// TODO: 在 InitComponent 調用后添加任何初始化

		}
		[DefaultValue("Black"),Description("邊框顏色"),Category("Appearance")] 
		public Color BorderColor
		{
			get 
			{
				// Insert code here.
				return _BorderColor;
			}
			set 
			{
				_BorderColor=value;
				this.Invalidate();
			}
		}
		[DefaultValue("Control"),Description("背景顏色"),Category("Appearance")] 
		public override Color BackColor
		{
			get 
			{
				// Insert code here.
				return _BackColor;
			}
			set 
			{
				_BackColor=value;
				this.Invalidate();
			}
		}
		[DefaultValue(false),Description("運行中控件大小是否可拖拽編輯"),Category("Behavior")] 
		public  bool ReSizeble
		{
			get 
			{
				// Insert code here.
				return _ReSizeble;
			}
			set 
			{
				_ReSizeble=value;
				this.Invalidate();
			}
		}
		[Description("控件選擇區域"),Category("Behavior")] 
		public  Rectangle SelectRectangle
		{
			get 
			{
				Rectangle selectRectangler=new Rectangle();
				selectRectangler.X = this.Location.X+7;
				selectRectangler.Y = this.Location.Y+7;
				selectRectangler.Height = this.Height-15;
				selectRectangler.Width = this.Width-15;
				return selectRectangler;
			}
		}
 
		protected override void OnPaint(PaintEventArgs pe)
		{
			// Calling the base class OnPaint
			base.OnPaint(pe);
			ReDrawControl(pe.Graphics);
		}


		private void DrawSelector(Graphics graphics)
		{
			SolidBrush SelectorPen=new SolidBrush(Color.White);
			Pen borderPen=new Pen(this._BorderColor,1);
			try
			{
				//實心

				PointF[] LeftPoints=getPointF(0,this.Height/2-3,6,6);
				graphics.FillClosedCurve(SelectorPen, LeftPoints);

				PointF[] TopPoints=getPointF(this.Width/2-3,0,6,6);
				graphics.FillClosedCurve(SelectorPen, TopPoints);

				PointF[] RightPoints=getPointF(this.Width-7,this.Height/2-3,6,6);
				graphics.FillClosedCurve(SelectorPen, RightPoints);

				PointF[] BottomPoints=getPointF(this.Width/2-3,this.Height-7,6,6);
				graphics.FillClosedCurve(SelectorPen, BottomPoints);

				PointF[] LeftTopPoints=getPointF(0,0,6,6);
				graphics.FillClosedCurve(SelectorPen, LeftTopPoints);

				PointF[] RightTopPoints=getPointF(this.Width-7,0,6,6);
				graphics.FillClosedCurve(SelectorPen, RightTopPoints);

				PointF[] RightBottomPoints=getPointF(this.Width-7,this.Height-7,6,6);
				graphics.FillClosedCurve(SelectorPen, RightBottomPoints);
    
				PointF[] LeftBottomPoints=getPointF(0,this.Height-7,6,6);
				graphics.FillClosedCurve(SelectorPen, LeftBottomPoints);
				//邊框
				_rectLeftSelector.X = 0;
				_rectLeftSelector.Y = this.Height/2-3;
				_rectLeftSelector.Height = 6;
				_rectLeftSelector.Width = 6;
				graphics.DrawRectangle(borderPen, _rectLeftSelector);

				_rectTopSelector.X = this.Width/2-3;
				_rectTopSelector.Y = 0;
				_rectTopSelector.Height = 6;
				_rectTopSelector.Width = 6;
				graphics.DrawRectangle(borderPen, _rectTopSelector);

				_rectRightSelector.X = this.Width-7;
				_rectRightSelector.Y = this.Height/2-3;
				_rectRightSelector.Height = 6;
				_rectRightSelector.Width = 6;
				graphics.DrawRectangle(borderPen, _rectRightSelector);

				_rectBottomSelector.X = this.Width/2-3;
				_rectBottomSelector.Y = this.Height-7;
				_rectBottomSelector.Height = 6;
				_rectBottomSelector.Width = 6;
				graphics.DrawRectangle(borderPen, _rectBottomSelector);

				_rectLeftTopSelector.X=0;
				_rectLeftTopSelector.Y=0;
				_rectLeftTopSelector.Width=6;
				_rectLeftTopSelector.Height=6;
				graphics.DrawRectangle(borderPen, _rectLeftTopSelector);

				_rectRightTopSelector.X=this.Width-7;
				_rectRightTopSelector.Y=0;
				_rectRightTopSelector.Width=6;
				_rectRightTopSelector.Height=6;
				graphics.DrawRectangle(borderPen, _rectRightTopSelector);

				_rectRightBottomSelector.X=this.Width-7;
				_rectRightBottomSelector.Y=this.Height-7;
				_rectRightBottomSelector.Width=6;
				_rectRightBottomSelector.Height=6;
				graphics.DrawRectangle(borderPen, _rectRightBottomSelector);

				_rectLeftBottomSelector.X=0;
				_rectLeftBottomSelector.Y=this.Height-7;
				_rectLeftBottomSelector.Width=6;
				_rectLeftBottomSelector.Height=6;
				graphics.DrawRectangle(borderPen, _rectLeftBottomSelector);
			}
			catch(Exception E)
			{
				throw E;
			}
			finally
			{
				SelectorPen.Dispose();
				borderPen.Dispose();
			}
    
		}
		private void ReDrawControl(Graphics graphics)
		{
   
			try
			{
   
				//繪制背景
				/*
				graphics.Clear(this._BackColor);
				SolidBrush backPen=new SolidBrush(this._BackColor);
				PointF point1 = new PointF(1,1);
				PointF point2 = new PointF(this.Width-2,1);
				PointF point3 = new PointF(this.Width-2,this.Height-2);
				PointF point4 = new PointF(1,this.Height-2);
				PointF[] points = {point1, point2, point3, point4};
				graphics.FillClosedCurve(backPen, points);
				*/
				//繪制邊框    
				Rectangle rectBorder=new Rectangle();
				Pen borderPen=new Pen(this._BorderColor,1);
				rectBorder.X = 7;
				rectBorder.Y = 7;
				rectBorder.Height = this.Height-15;
				rectBorder.Width = this.Width-15;
				graphics.DrawRectangle(borderPen, rectBorder);
				//繪制編輯框
				if (_ReSizeble)
				{
					DrawSelector(graphics);
				}
			}
			catch(Exception E)
			{
				throw E;
			}
			finally
			{
				graphics.Dispose();
			}
		}
		/// <summary>
		/// 清理所有正在使用的資源。
		/// </summary>
		private PointF[] getPointF(int x,int y,int Width,int Height)
		{
			PointF point1 = new PointF(x,y);
			PointF point2 = new PointF(x+Width,y);
			PointF point3 = new PointF(x+Width,y+Height);
			PointF point4 = new PointF(x,y+Height);
			PointF[] points = {point1, point2, point3, point4};
			return points;
		}
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if( components != null )
					components.Dispose();
			}
			base.Dispose( disposing );
		}

		#region 組件設計器生成的代碼
		/// <summary>
		/// 設計器支持所需的方法 - 不要使用代碼編輯器 
		/// 修改此方法的內容。
		/// </summary>
		private void InitializeComponent()
		{
			this.dataGrid1 = new System.Windows.Forms.DataGrid();
			this.dataGrid2 = new System.Windows.Forms.DataGrid();
			((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.dataGrid2)).BeginInit();
			// 
			// dataGrid1
			// 
			this.dataGrid1.DataMember = "";
			this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
			this.dataGrid1.Location = new System.Drawing.Point(17, 17);
			this.dataGrid1.Name = "dataGrid1";
			this.dataGrid1.TabIndex = 0;
			// 
			// dataGrid2
			// 
			this.dataGrid2.DataMember = "";
			this.dataGrid2.HeaderForeColor = System.Drawing.SystemColors.ControlText;
			this.dataGrid2.Location = new System.Drawing.Point(117, 17);
			this.dataGrid2.Name = "dataGrid2";
			this.dataGrid2.TabIndex = 0;
			// 
			// ShapeEx
			// 
			this.Resize += new System.EventHandler(this.ShapeEx_Resize);
			this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.ShapeEx_MouseUp);
			this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.ShapeEx_MouseMove);
			this.MouseLeave += new System.EventHandler(this.ShapeEx_MouseLeave);
			this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.ShapeEx_MouseDown);
			((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.dataGrid2)).EndInit();

		}
		#endregion

		private void ShapeEx_Resize(object sender, EventArgs e)
		{
			if (this.Width<16 || this.Height<16)
			{
				this.Width=16;
				this.Height=16;
			}
			this.Invalidate();
		}

 

		private void ShapeEx_MouseDown(object sender, MouseEventArgs e)
		{
			if (_ReSizeble)
			{
				if (_rectLeftSelector.Contains(e.X,e.Y) || _rectRightSelector.Contains(e.X,e.Y) || _rectTopSelector.Contains(e.X,e.Y) || _rectBottomSelector.Contains(e.X,e.Y) ||_rectLeftTopSelector.Contains(e.X,e.Y) || _rectRightTopSelector.Contains(e.X,e.Y) || _rectRightBottomSelector.Contains(e.X,e.Y) || _rectLeftBottomSelector.Contains(e.X,e.Y))
				{
					if (_rectLeftTopSelector.Contains(e.X,e.Y) )
					{
						this.Cursor=Cursors.SizeNWSE;
						this._SelectSelctedIndex=1;
					}
     
					if (_rectTopSelector.Contains(e.X,e.Y) )
					{
						this.Cursor=Cursors.SizeNS;
						this._SelectSelctedIndex=2;
					}
					if (_rectRightTopSelector.Contains(e.X,e.Y) )
					{
						this.Cursor=Cursors.SizeNESW;
						this._SelectSelctedIndex=3;
					}
					if (_rectRightSelector.Contains(e.X,e.Y) )
					{
						this.Cursor=Cursors.SizeWE;
						this._SelectSelctedIndex=4;
					}
					if (_rectRightBottomSelector.Contains(e.X,e.Y) )
					{
						this.Cursor=Cursors.SizeNWSE;
						this._SelectSelctedIndex=5;
					}
					if (_rectBottomSelector.Contains(e.X,e.Y))
					{
						this.Cursor=Cursors.SizeNS;
						this._SelectSelctedIndex=6;
					}
					if (_rectLeftBottomSelector.Contains(e.X,e.Y) )
					{
						this.Cursor=Cursors.SizeNESW;
						this._SelectSelctedIndex=7;
					}
					if (_rectLeftSelector.Contains(e.X,e.Y))
					{
						this.Cursor=Cursors.SizeWE;
						this._SelectSelctedIndex=8;
					}

				}
				else
				{
					this.Cursor=Cursors.SizeAll;
					this._SelectSelctedIndex=0;
				}
				this._SelfLocation.X=this.Location.X;
				this._SelfLocation.Y=this.Location.Y;
				this._MouseLocation.X=Cursor.Position.X;
				this._MouseLocation.Y=Cursor.Position.Y;
				this._SelfWidth=this.Width;
				this._SelfHeight=this.Height;
			}
		}



		private void ShapeEx_MouseMove(object sender, MouseEventArgs e)
		{
			//move and resize
			switch (this._SelectSelctedIndex)
			{
				case 0:
					this.Location=new Point(Cursor.Position.X-(_MouseLocation.X-_SelfLocation.X),Cursor.Position.Y-(_MouseLocation.Y-_SelfLocation.Y));
					break;
				case 1:
					this.Height=this._SelfHeight-(Cursor.Position.Y-_MouseLocation.Y);
					this.Width=this._SelfWidth-(Cursor.Position.X-_MouseLocation.X);
					this.Location=new Point(Cursor.Position.X-_MouseLocation.X+_SelfLocation.X,Cursor.Position.Y-_MouseLocation.Y+_SelfLocation.Y);
					break;
				case 2:
					this.Height=this._SelfHeight-(Cursor.Position.Y-_MouseLocation.Y);
					this.Location=new Point(_SelfLocation.X,Cursor.Position.Y-_MouseLocation.Y+_SelfLocation.Y);
					break;
				case 3:
					this.Height=this._SelfHeight-(Cursor.Position.Y-_MouseLocation.Y);
					this.Width=this._SelfWidth+(Cursor.Position.X-_MouseLocation.X);
					this.Location=new Point(_SelfLocation.X,Cursor.Position.Y-(_MouseLocation.Y-_SelfLocation.Y));
					break;
				case 4:
					this.Width=this._SelfWidth+(Cursor.Position.X-_MouseLocation.X);
					break;
				case 5:
					this.Height=this._SelfHeight+(Cursor.Position.Y-_MouseLocation.Y);
					this.Width=this._SelfWidth+(Cursor.Position.X-_MouseLocation.X);
					break;
				case 6:
					this.Height=this._SelfHeight+(Cursor.Position.Y-_MouseLocation.Y);
					break;
				case 7:
					this.Height=this._SelfHeight+(Cursor.Position.Y-_MouseLocation.Y);
					this.Width=this._SelfWidth-(Cursor.Position.X-_MouseLocation.X);
					this.Location=new Point(Cursor.Position.X-_MouseLocation.X+_SelfLocation.X,_SelfLocation.Y);
					break;
				case 8:
					this.Width=this._SelfWidth-(Cursor.Position.X-_MouseLocation.X);
					this.Location=new Point(Cursor.Position.X-_MouseLocation.X+_SelfLocation.X,_SelfLocation.Y);
					break;
			}
		}



		private void ShapeEx_MouseLeave(object sender, EventArgs e)
		{
			this.Cursor=Cursors.Default;
			this._SelectSelctedIndex=-1;
		}


		private void ShapeEx_MouseUp(object sender, MouseEventArgs e)
		{
			this.Cursor=Cursors.Default;
			this._SelectSelctedIndex=-1;
		}
	}
}


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品写真视频在线观看| 亚洲成人精品在线观看| 久久亚洲综合色一区二区三区| 亚洲三级电影网站| 亚洲欧美国产77777| 五月婷婷欧美视频| 日韩成人精品视频| 精品中文字幕一区二区| 99久久伊人网影院| 欧美三级日韩三级国产三级| 欧美r级电影在线观看| 91精品婷婷国产综合久久 | 日韩一区二区影院| 久久久久久久久97黄色工厂| 亚洲品质自拍视频| 久久99国产精品免费| 91污在线观看| 欧美一区二区三区免费| 9久草视频在线视频精品| 欧美精品一卡两卡| 色综合天天性综合| 日韩欧美国产一二三区| 日韩欧美一卡二卡| 国产精品免费免费| 日韩中文字幕一区二区三区| 国内精品嫩模私拍在线| 91一区二区三区在线观看| 日韩一区二区三区视频在线观看| 久久久三级国产网站| 舔着乳尖日韩一区| 成人高清视频在线| 精品国精品国产| 五月天丁香久久| 在线亚洲人成电影网站色www| 欧洲精品一区二区三区在线观看| 色综合久久综合网97色综合| 国产丝袜欧美中文另类| 亚洲一区二区三区视频在线 | 性久久久久久久久久久久| 成人免费av在线| 亚洲国产精品ⅴa在线观看| 亚洲精选免费视频| 99视频精品在线| 国产精品美日韩| 国产一区视频网站| 欧美精品精品一区| 国产色产综合产在线视频| 亚洲444eee在线观看| 欧美色图一区二区三区| 舔着乳尖日韩一区| 日韩美女主播在线视频一区二区三区| 午夜精品国产更新| 91激情在线视频| 久久久99久久精品欧美| 春色校园综合激情亚洲| 亚洲色图制服诱惑 | 欧美精品99久久久**| 一区二区三区精品在线观看| 在线成人免费观看| 国产精品资源在线观看| 中文字幕一区二区日韩精品绯色| 欧美私模裸体表演在线观看| 亚洲一区二区三区视频在线| 欧美刺激脚交jootjob| 成人毛片视频在线观看| 丝袜脚交一区二区| 久久久高清一区二区三区| 国产综合色视频| 日韩女优av电影在线观看| 天堂久久一区二区三区| 色综合咪咪久久| 亚洲一二三区视频在线观看| 精品欧美一区二区三区精品久久 | 午夜国产精品一区| 国产精品国产三级国产普通话蜜臀| 91香蕉视频在线| 激情综合亚洲精品| 国产亚洲一二三区| 777奇米成人网| 91丨porny丨首页| 久久精品噜噜噜成人88aⅴ| 亚洲一区二区四区蜜桃| 中文一区在线播放| 国产亚洲一区二区在线观看| 91精品免费在线| 欧美电影在哪看比较好| 欧美色综合久久| 精品视频一区三区九区| 一本一道波多野结衣一区二区 | 国模一区二区三区白浆| 午夜欧美大尺度福利影院在线看| 亚洲精品在线观| 日韩一区和二区| 欧美一卡在线观看| 日韩欧美国产午夜精品| 精品国产一区二区三区四区四 | 欧美日韩一级片在线观看| 91国偷自产一区二区开放时间| 色婷婷综合久久久久中文| 在线中文字幕不卡| 欧美一区二区三区在线| 色菇凉天天综合网| 欧美日韩国产天堂| 91精品国产全国免费观看| 日韩精品一区二区三区视频| 日韩一级在线观看| 国产色91在线| 亚洲国产成人av| 国产传媒日韩欧美成人| 91网站黄www| 日韩欧美电影一区| 国产精品久久久久久久久快鸭 | 亚洲主播在线观看| 国产毛片精品视频| 欧美日韩三级一区二区| 久久人人97超碰com| 亚洲一区在线免费观看| 日本aⅴ亚洲精品中文乱码| 亚洲视频狠狠干| 性感美女极品91精品| 另类人妖一区二区av| 欧美一a一片一级一片| 久久久久久久网| 麻豆91免费观看| 欧美视频在线一区| 国产精品福利一区| 国产69精品久久久久毛片| 91.麻豆视频| 亚洲国产aⅴ成人精品无吗| 成人免费看视频| 日韩一区二区在线看| 亚洲精品日日夜夜| 麻豆国产欧美一区二区三区| 99精品视频在线免费观看| 久久久久久久久久久久久久久99 | 奇米影视一区二区三区小说| 精品视频免费看| 天涯成人国产亚洲精品一区av| 在线精品视频免费播放| 一区二区久久久久| 精品视频资源站| 蜜桃一区二区三区在线观看| 在线观看亚洲专区| 一区二区三区精品视频| 91黄色免费网站| 蜜桃av一区二区在线观看| 精品国产亚洲在线| 成人一区二区三区视频在线观看| 国产欧美一区二区三区在线看蜜臀| 国产白丝精品91爽爽久久 | 樱花影视一区二区| 51久久夜色精品国产麻豆| 日韩成人免费电影| 久久久久久99久久久精品网站| av激情综合网| 精品一区二区在线观看| 国产精品妹子av| 欧美成人一区二区三区片免费 | 奇米色777欧美一区二区| 日韩一区二区免费高清| 99亚偷拍自图区亚洲| 亚洲高清视频的网址| 欧美性感一区二区三区| 丁香激情综合国产| 亚洲成人午夜电影| 亚洲婷婷综合久久一本伊一区| 欧美一区二区成人6969| 成人黄色777网| 日本中文字幕一区二区视频| 日日摸夜夜添夜夜添精品视频| 性感美女久久精品| 在线不卡中文字幕| 国产一区在线不卡| 国产精品不卡在线| 精品国产乱码久久久久久牛牛| 在线视频你懂得一区二区三区| 国产一区二区调教| 国产a区久久久| 美女高潮久久久| 看电影不卡的网站| 日韩在线观看一区二区| 亚洲乱码精品一二三四区日韩在线 | 成人亚洲精品久久久久软件| 国产在线视频精品一区| 日本伊人午夜精品| 美女www一区二区| 久久99精品国产麻豆婷婷| 美国欧美日韩国产在线播放| 亚洲视频资源在线| 337p日本欧洲亚洲大胆精品| 91精品国产综合久久久蜜臀粉嫩| 555夜色666亚洲国产免| 欧美精品一区二区三区蜜臀| 欧美激情一区二区三区不卡| 中文字幕在线一区二区三区| 亚洲精品自拍动漫在线| 三级欧美在线一区| 亚洲欧美国产77777| 中文字幕在线一区| 秋霞午夜鲁丝一区二区老狼|