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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? usagecontrol.cs

?? 線程池實(shí)例,1.1版本,用于代替.net自帶線程池
?? CS
字號:
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Data;
using System.Windows.Forms;

namespace UsageControl
{
	/// <summary>
	/// Summary description for UsageControl.
	/// </summary>
	public class UsageControl : System.Windows.Forms.UserControl
	{
		private System.ComponentModel.IContainer components = null;
		
		private const int ovalWidth = 18;
		private const int columns = 2;

		private int fixedWidth;
		private int rows = 1; 

		private int min = 0;	// Minimum value for progress range
		private int max = 100;	// Maximum value for progress range
		private int val1 = 0;	// Current progress
		private int val2 = 0;	// Current progress

		public UsageControl()
		{
			// This call is required by the Windows.Forms Form Designer.
			InitializeComponent();

			EnableDoubleBuffering();
			fixedWidth = 2 + (ovalWidth+1)*columns + 1;
		}

		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		private void EnableDoubleBuffering()
		{
			// Set the value of the double-buffering style bits to true.
			this.SetStyle(ControlStyles.DoubleBuffer | 
				ControlStyles.UserPaint | 
				ControlStyles.AllPaintingInWmPaint,
				true);
			this.UpdateStyles();
		}

		#region Component 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()
		{
			// 
			// UsageControl
			// 
			this.BackColor = System.Drawing.Color.Black;
			this.Name = "UsageControl";
			this.Size = new System.Drawing.Size(192, 160);

		}
		#endregion

		protected override void OnResize(EventArgs e)
		{
			Width = fixedWidth;
			rows = (ClientRectangle.Height / 4) - 1;
			// Invalidate the control to get a repaint.
			this.Invalidate();
		}

		protected override void OnPaint(PaintEventArgs e)
		{
			Graphics g = e.Graphics;

			int percent1 = ((val1 - min) * 100) / (max - min);
			int percent2 = ((val2 - min) * 100) / (max - min);

			int filledCount1 = (rows * percent1) / 100;
			int filledCount2 = (rows * percent2) / 100;
			int diff = Math.Abs(filledCount1 - filledCount2);

			int emptyCount = rows - Math.Max(filledCount1, filledCount2);

			int i = 0;

			for(i = 0; i < filledCount1; ++i)
			{
				for(int j = 0; j < columns; ++j)
				{
					DrawOval(
						g, 
						Pens.LawnGreen,
						2 + j*(1+ovalWidth), 
						ClientRectangle.Bottom - 5 - i*4);
				}
			}

			for(; i < filledCount2; ++i)
			{
				for(int j = 0; j < columns; ++j)
				{
					DrawOval(
						g, 
						Pens.Red,
						2 + j*(1+ovalWidth), 
						ClientRectangle.Bottom - 5 - i*4);
				}
			}

			for(; i < rows; ++i)
			{
				for(int j = 0; j < columns; ++j)
				{
					DrawOval(
						g, 
						Pens.Green,
						2 + j*(1+ovalWidth), 
						ClientRectangle.Bottom - 5 - i*4);
				}
			}

			// Draw a three-dimensional border around the control.
			Draw3DBorder(g);

			// Clean up.
			//g.Dispose();
			base.OnPaint (e);
		}

		private void DrawOval(Graphics g, Pen pen, int x, int y)
		{
			g.DrawLine(pen, x+1 , y, x+ovalWidth-2, y);
			g.DrawLine(pen, x, y+1, x+ovalWidth-1, y+1);
			g.DrawLine(pen, x+1, y+2, x+ovalWidth-2, y+2);
		}

		public int Maximum
		{
			get
			{
				return max;
			}

			set
			{
				// Make sure that the maximum value is never set lower than the minimum value.
				if (value < min)
				{
					min = value;
				}

				max = value;

				// Make sure that value is still in range.
				if (val1 > max)
				{
					val1 = max;
				}

				// Invalidate the control to get a repaint.
				this.Invalidate();
			}
		}

		public int Value1
		{
			get
			{
				return val1;
			}

			set
			{
				int oldValue = val1;

				// Make sure that the value does not stray outside the valid range.
				if (value < min)
				{
					val1 = min;
				}
				else if (value > max)
				{
					val1 = max;
				}
				else
				{
					val1 = value;
				}
				Invalidate();
/*
				// Invalidate only the changed area.
				float percent;

				Rectangle newValueRect = this.ClientRectangle;
				Rectangle oldValueRect = this.ClientRectangle;

				// Use a new value to calculate the rectangle for progress.
				percent = (float)(val1 - min) / (float)(max - min);
				newValueRect.Width = (int)((float)newValueRect.Width * percent);

				// Use an old value to calculate the rectangle for progress.
				percent = (float)(oldValue - min) / (float)(max - min);
				oldValueRect.Width = (int)((float)oldValueRect.Width * percent);

				Rectangle updateRect = new Rectangle();

				// Find only the part of the screen that must be updated.
				if (newValueRect.Width > oldValueRect.Width)
				{
					updateRect.X = oldValueRect.Size.Width;
					updateRect.Width = newValueRect.Width - oldValueRect.Width;
				}
				else
				{
					updateRect.X = newValueRect.Size.Width;
					updateRect.Width = oldValueRect.Width - newValueRect.Width;
				}

				updateRect.Height = this.Height;

				// Invalidate the intersection region only.
				this.Invalidate(updateRect);
*/
			}
		}

		public int Value2
		{
			get
			{
				return val2;
			}

			set
			{
				int oldValue = val2;

				// Make sure that the value does not stray outside the valid range.
				if (value < min)
				{
					val2 = min;
				}
				else if (value > max)
				{
					val2 = max;
				}
				else
				{
					val2 = value;
				}
				Invalidate();

				/*
								// Invalidate only the changed area.
								float percent;

								Rectangle newValueRect = this.ClientRectangle;
								Rectangle oldValueRect = this.ClientRectangle;

								// Use a new value to calculate the rectangle for progress.
								percent = (float)(val1 - min) / (float)(max - min);
								newValueRect.Width = (int)((float)newValueRect.Width * percent);

								// Use an old value to calculate the rectangle for progress.
								percent = (float)(oldValue - min) / (float)(max - min);
								oldValueRect.Width = (int)((float)oldValueRect.Width * percent);

								Rectangle updateRect = new Rectangle();

								// Find only the part of the screen that must be updated.
								if (newValueRect.Width > oldValueRect.Width)
								{
									updateRect.X = oldValueRect.Size.Width;
									updateRect.Width = newValueRect.Width - oldValueRect.Width;
								}
								else
								{
									updateRect.X = newValueRect.Size.Width;
									updateRect.Width = oldValueRect.Width - newValueRect.Width;
								}

								updateRect.Height = this.Height;

								// Invalidate the intersection region only.
								this.Invalidate(updateRect);
				*/
			}
		}

		private void Draw3DBorder(Graphics g)
		{
			int PenWidth = (int)Pens.White.Width;

			g.DrawLine(Pens.DarkGray,
				new Point(this.ClientRectangle.Left, this.ClientRectangle.Top),
				new Point(this.ClientRectangle.Width - PenWidth, this.ClientRectangle.Top));
			g.DrawLine(Pens.DarkGray,
				new Point(this.ClientRectangle.Left, this.ClientRectangle.Top),
				new Point(this.ClientRectangle.Left, this.ClientRectangle.Height - PenWidth));
			g.DrawLine(Pens.White,
				new Point(this.ClientRectangle.Left, this.ClientRectangle.Height - PenWidth),
				new Point(this.ClientRectangle.Width - PenWidth, this.ClientRectangle.Height - PenWidth));
			g.DrawLine(Pens.White,
				new Point(this.ClientRectangle.Width - PenWidth, this.ClientRectangle.Top),
				new Point(this.ClientRectangle.Width - PenWidth, this.ClientRectangle.Height - PenWidth));
		}


	}
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲v中文字幕| 国产精品久久久久9999吃药| 丝袜美腿成人在线| 欧美精品粉嫩高潮一区二区| 亚洲福利国产精品| 91精品国产综合久久婷婷香蕉 | wwwwxxxxx欧美| 国产电影一区在线| 亚洲色图19p| 欧美日韩在线播放| 蜜臀av国产精品久久久久| 日韩午夜激情av| 国产a级毛片一区| 亚洲自拍欧美精品| 欧美刺激午夜性久久久久久久| 久久99精品久久久久久久久久久久| 国产亚洲一区二区三区在线观看| www..com久久爱| 日日欢夜夜爽一区| 国产欧美精品一区| 欧美亚洲禁片免费| 日韩av二区在线播放| 国产欧美日韩精品一区| 欧美日韩一二三区| 国产一区二区看久久| 一区二区三区在线视频播放| 日韩一级完整毛片| 91丝袜美女网| 开心九九激情九九欧美日韩精美视频电影| 国产日韩欧美精品一区| 欧美日韩卡一卡二| 国产一区二区三区黄视频 | 久久亚洲私人国产精品va媚药| 成人av在线网| 午夜精品视频一区| 国产精品你懂的在线| 欧美日韩卡一卡二| 波多野结衣91| 国产一区二区中文字幕| 亚洲综合一二区| 国产午夜亚洲精品羞羞网站| 欧美日本视频在线| av电影在线观看完整版一区二区| 日韩av电影一区| 亚洲一区二区五区| 国产精品网站在线观看| 欧美videofree性高清杂交| 色妹子一区二区| 狠狠色丁香婷婷综合久久片| 亚洲国产一二三| 中文字幕一区av| 久久久久久久久蜜桃| 欧美一区中文字幕| 欧美日韩在线三级| 91视频在线看| 成人一区二区三区| 激情亚洲综合在线| 日本一道高清亚洲日美韩| 亚洲精品成a人| 国产精品青草久久| 国产亚洲欧洲一区高清在线观看| 欧美一区二区三区四区在线观看 | 亚洲成a人v欧美综合天堂| 日韩一区日韩二区| 国产精品视频一二三| 亚洲国产精品成人综合| 久久新电视剧免费观看| 日韩欧美在线网站| 欧美一区二区三区免费大片| 欧美日韩久久一区| 欧美日韩国产欧美日美国产精品| 在线亚洲人成电影网站色www| 99久久精品99国产精品 | 亚洲综合一二区| 一区二区在线免费| 玉米视频成人免费看| 亚洲裸体xxx| 一区二区三区.www| 亚洲综合色自拍一区| 亚洲国产一区二区在线播放| 亚洲第一在线综合网站| 日韩av高清在线观看| 男男视频亚洲欧美| 国产一区中文字幕| 国产成人av电影在线观看| 国产传媒久久文化传媒| 欧美亚洲日本国产| 7777精品伊人久久久大香线蕉超级流畅| 欧美日韩精品一区二区三区四区| 欧美午夜视频网站| 正在播放一区二区| 久久久久国产一区二区三区四区| 国产精品热久久久久夜色精品三区 | 欧美一区二区三区电影| 日韩欧美亚洲一区二区| 国产日韩欧美麻豆| 亚洲免费av高清| 日韩高清欧美激情| 国产一区二区三区综合| 99久久国产综合色|国产精品| 一本色道久久加勒比精品| 欧美精品久久天天躁| 精品国产一区二区三区忘忧草| 国产日韩精品一区二区三区 | 国产日产亚洲精品系列| 国产精品拍天天在线| 亚洲免费观看高清完整| 偷拍亚洲欧洲综合| 久久超级碰视频| 99v久久综合狠狠综合久久| 欧美人xxxx| 久久久久久久电影| 亚洲国产日日夜夜| 国产一区二区三区四| 色婷婷av一区| 日韩精品在线网站| 亚洲免费大片在线观看| 精品亚洲欧美一区| 色美美综合视频| 26uuu亚洲综合色| 亚洲中国最大av网站| 国产精品一二三区在线| 在线精品视频免费播放| 久久免费精品国产久精品久久久久| 亚洲欧美日韩电影| 国产伦精品一区二区三区视频青涩| 色狠狠av一区二区三区| 国产婷婷精品av在线| 午夜精品免费在线| 99vv1com这只有精品| 久久久亚洲高清| 日本中文一区二区三区| 99视频热这里只有精品免费| 日韩欧美在线观看一区二区三区| 亚洲视频每日更新| 国产精品888| 日韩女优av电影| 亚洲一区在线观看视频| 成人国产精品免费观看动漫| 91精品国产一区二区三区蜜臀| 综合色中文字幕| 国产黄色91视频| 日韩欧美亚洲国产另类| 亚洲va韩国va欧美va精品 | 国产成人精品免费网站| 91精品国产综合久久久久久久| 日韩一区在线播放| 成人听书哪个软件好| 久久久久久97三级| 久久97超碰国产精品超碰| 91精品午夜视频| 天天色综合成人网| 欧美一a一片一级一片| 亚洲精品国产一区二区精华液| 不卡视频在线看| 欧美精彩视频一区二区三区| 国内久久精品视频| 久久中文娱乐网| 国产一区视频导航| 久久精品亚洲乱码伦伦中文| 极品少妇一区二区三区精品视频| 欧美一区二区久久| 肉丝袜脚交视频一区二区| 欧美日韩电影一区| 无码av免费一区二区三区试看| 欧亚洲嫩模精品一区三区| 一区二区三区av电影| 欧美午夜不卡视频| 亚洲成a人v欧美综合天堂下载 | 99精品视频在线播放观看| 亚洲欧洲无码一区二区三区| 97精品久久久午夜一区二区三区| 18欧美亚洲精品| 色综合久久88色综合天天免费| 一区二区三区中文字幕| 欧美性淫爽ww久久久久无| 久久成人久久爱| 精品国产麻豆免费人成网站| 国内一区二区视频| 国产精品三级在线观看| 99精品国产视频| 又紧又大又爽精品一区二区| 欧美巨大另类极品videosbest | 亚洲综合一区在线| 欧美精品一二三四| 蜜桃91丨九色丨蝌蚪91桃色| 久久久久97国产精华液好用吗| 成人精品免费视频| 一区二区三区欧美在线观看| 欧美精品aⅴ在线视频| 精油按摩中文字幕久久| 国产精品私房写真福利视频| 在线观看av一区二区| 日本午夜精品视频在线观看| 久久久一区二区| 91久久精品一区二区二区| 毛片一区二区三区| 中文字幕制服丝袜一区二区三区| 欧美最新大片在线看| 久久se这里有精品|