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

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

?? specialmenuprovider.cs

?? c#編寫的汽車銷售公司erp進(jìn)銷存系統(tǒng)
?? CS
?? 第 1 頁 / 共 2 頁
字號:
using System;
using System.ComponentModel;
using System.Collections;
using System.ComponentModel.Design;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace SpecialMenu
{
	/// <summary>
	/// Provides all MenuItems the appearance of Office 2003 MenuItems
	/// </summary>
	[ProvideProperty("NewStyleActive",typeof(MenuItem))]
	[ProvideProperty("MenuGlyph",typeof(MenuItem))]
	[ToolboxBitmap(typeof(SpecialMenuProvider),"images.SpecialMenuProvider.bmp")]
	public class SpecialMenuProvider : Component,IExtenderProvider 
	{
		#region types
		/// <summary>
		/// Used to store the provided properties in the Hashtable
		/// </summary>
		internal class MenuItemInfo
		{
			/// <summary>
			/// Creates a new MenuItemInfo struct
			/// </summary>
			/// <param name="newstyle">specifies if the MenuItem should be painted using Office 2003 style or not</param>
			/// <param name="glyph">the image to draw next to the MenuItem</param>
			public MenuItemInfo(bool newstyle, Image glyph)
			{
				this.NewStyle=newstyle;
				this.Glyph=glyph;
			}
			//Fields
			public bool NewStyle;
			public Image Glyph;
		}
		/// <summary>
		/// Used to collect the information for drawing an Item
		/// </summary>
		internal class DrawItemInfo
		{
			/// <summary>
			/// Creates a new DawItemInfo struct
			/// </summary>
			/// <param name="sender">reference to the MenuItem to be painted</param>
			/// <param name="e">the DrawItemEventArgs with additional information</param>
			/// <param name="glyph">the image to draw next to the item</param>
			public DrawItemInfo(object sender, DrawItemEventArgs e, Image glyph)
			{
				this.Item=(MenuItem)sender;
				this.Glyph=glyph;

				this.Disabled=(e.State&DrawItemState.Disabled)==DrawItemState.Disabled;
				this.Selected=(e.State&DrawItemState.Selected)==DrawItemState.Selected;
				this.Checked=(e.State&DrawItemState.Checked)==DrawItemState.Checked;
				this.HotLight=(e.State&DrawItemState.HotLight)==DrawItemState.HotLight;
				this.Rct=e.Bounds;
			}
			/// <summary>
			/// Evaluates, whether the currently drawn
			/// item is an Item in the Top-band of a MainMenu, or not
			/// </summary>
			public bool IsTopItem
			{
				get{return Item.Parent==Item.Parent.GetMainMenu();}
			}
			/// <summary>
			/// Gets the associated MainMenu, if possible
			/// </summary>
			public MainMenu MainMenu
			{
				get{return Item.Parent.GetMainMenu();}
			}
			//Fields
			public Image Glyph;
			public bool HotLight, Selected, Disabled, Checked;
			public Rectangle Rct;
			public MenuItem Item;
		}
		#endregion
		#region variables
		private Container components;//required for designer
		private Hashtable _menuitems;//stores the associated menuitems
		private Form _owner=null;//the owning form, used for hooking
		private IntPtr _hook=IntPtr.Zero;//hook handle
		private Win32.HookProc _hookprc=null;//hook delegate
		private MenuHook lastHook=null;//reference to last MenuHook

		private StringFormat fmt=new StringFormat();//used for painting
		private const int _margin=26;//width of the image-band next to each item
		private int _lastwidth=0;//width of the last TopItem
		private LinearGradientBrush 
			lnbrs=new LinearGradientBrush(new Point(0,0),new Point(1,0),
			Color.FromArgb(227,239,255),Color.FromArgb(135,173,228));//used for every kind of gradient filling

		private Pen border=new Pen(Color.FromArgb(0,0,128));//used for boder/selectionframe painting
		private SolidBrush hotbrs=new SolidBrush(Color.White);//used for every kind of plain filling
		private static Color _imgageband1=Color.FromArgb(227,239,255);//圖片區(qū)顏色1
		public static Color imgageband1
		{
			get
			{
				return _imgageband1;
			}
			set
			{
				_imgageband1=value;
			}
		}
		private static Color _imgageband2=Color.FromArgb(135,173,228);//圖片區(qū)顏色2
		public static Color imgageband2
		{
			get
			{
				return _imgageband2;
			}
			set
			{
				_imgageband2=value;
			}
		}
		private static Color _mainmenuband1=Color.FromArgb(195,218,249);//主菜單區(qū)顏色1
		public static Color mainmenuband1
		{
			get
			{
				return _mainmenuband1;
			}
			set
			{
				_mainmenuband1=value;
			}
		}
		private static Color _mainmenuband2=Color.FromArgb(158,190,245);//主菜單區(qū)顏色2
		public static Color mainmenuband2
		{
			get
			{
				return _mainmenuband2;
			}
			set
			{
				_mainmenuband2=value;
			}
		}
		private static Color _hotlight1=Color.FromArgb(195,218,249);//熱區(qū)顏色1
		public static Color hotlight1
		{
			get
			{
				return _hotlight1;
			}
			set
			{
				_hotlight1=value;
			}
		}
		private static Color _hotlight2=Color.FromArgb(158,190,245);//熱區(qū)顏色2
		public static Color hotlight2
		{
			get
			{
				return _hotlight2;
			}
			set
			{
				_hotlight2=value;
			}
		}
		private Color[][] _cols=new Color[][]//color collection
		{
			new Color[]{imgageband1,imgageband2},//image band
			new Color[]{mainmenuband1,mainmenuband2},//mainmenu band
			new Color[]{hotlight1,hotlight2}//selection/hotlight
		};
		#endregion
		/// <summary>
		/// ctor
		/// </summary>
		public SpecialMenuProvider() 
		{
			this.components = new System.ComponentModel.Container ();
			_menuitems = new Hashtable();
			fmt.HotkeyPrefix=System.Drawing.Text.HotkeyPrefix.Show;
		}
		/// <summary>
		/// Free all used resources
		/// </summary>
		/// <param name="disposing">specifies, if managed resources are destroyed</param>
		protected override void Dispose(bool disposing) 
		{
			if (disposing) 
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose(disposing);
		}
		#region controller
		/// <summary>
		/// Can only extend MenuItems
		/// </summary>
		bool IExtenderProvider.CanExtend(object target) 
		{
			return target is MenuItem;
		}
		/// <summary>
		/// Used for making sure, the owning form is hooked
		/// </summary>
		public override ISite Site
		{
			get{return base.Site;}
			set
			{
				base.Site = value;
				if (this.Site != null)
				{
					IDesignerHost host1 = (IDesignerHost) this.Site.GetService(typeof(IDesignerHost));
					if ((host1 != null) && (host1.RootComponent is Form))
					{
						this.OwnerForm = (Form) host1.RootComponent;
					}
				}
			}
		}
		/// <summary>
		/// Measures the item
		/// </summary>
		private void control_MeasureItem(object sender, MeasureItemEventArgs e)
		{
			MenuItem mnu=(MenuItem)sender;

			if (mnu.Text=="-"){e.ItemHeight=3; return;}//MenuItem is Separator

			string txt=mnu.Text.Replace(@"&","");//dont measure '&' because it is replaced by an underline segment
			
			if (mnu.Shortcut!=Shortcut.None && mnu.ShowShortcut)
				txt+=GetShortcutString((Keys)mnu.Shortcut);//Get MenuShortcut, if visible

			int twidth=(int)e.Graphics.MeasureString(txt,mnu.DefaultItem?//Measure the string
				new Font(SystemInformation.MenuFont,FontStyle.Bold)//if the item is the DefaultItem, BOLD Font is used
				:SystemInformation.MenuFont
				,PointF.Empty,fmt).Width;

			if(mnu.Parent==mnu.Parent.GetMainMenu())//Item is in Top-Band of a MainMenu
			{
				e.ItemHeight=16;
				e.ItemWidth=twidth+2;
			}
			else//item is in a context/popup menu
			{
				e.ItemHeight=23;
				e.ItemWidth=twidth+45+_margin;
			}
		}
		/// <summary>
		/// Draw The Item
		/// </summary>
		private void control_DrawItem(object sender, DrawItemEventArgs e)
		{
			//collect the information used for drawing
			DrawItemInfo inf=new DrawItemInfo(sender,e,
				GetMenuGlyph((MenuItem)sender));

			if (inf.IsTopItem)//draw TopItem
			{
				#region draw Band
				Form frm=inf.MainMenu.GetForm();//owning form

				int width=frm.ClientSize.Width+//width of the MainMenu + Width of one Form Border
					(frm.Width-frm.ClientSize.Width)/2;
				
				lnbrs.LinearColors=_cols[1];//use Band colors

				lnbrs.Transform=new Matrix(-(float)width,0f,0f,1f,0f,0f);//scale the brush to the band

				if (e.Index==inf.MainMenu.MenuItems.Count-1)//item is last in line, draw the rest, too
					e.Graphics.FillRectangle(lnbrs,
						inf.Rct.X,inf.Rct.Y,width-inf.Rct.X,inf.Rct.Height);
				else//item is in line, just draw itself
					e.Graphics.FillRectangle(lnbrs,inf.Rct);
				#endregion
				#region layout
				//set the lastwidth field
				_lastwidth=0; if (inf.Selected) _lastwidth=e.Bounds.Width;
				#endregion
				#region draw TopItem
				inf.Rct.Width--;inf.Rct.Height--;//resize bounds

				lnbrs.Transform=new Matrix(0f,inf.Rct.Height,1f,0f,0f,inf.Rct.Y);//scale brush
				
				if (inf.Selected && !inf.Item.IsParent)//if the item has no subitems,
					inf.HotLight=true;//unfolding tab appearance is wrong, use hotlight appearance instead
				
				if (inf.HotLight && !inf.Disabled)//hot light appearance
				{
					lnbrs.LinearColors=_cols[2];//use hotlight colors

					e.Graphics.FillRectangle(lnbrs,inf.Rct);//draw the background

					e.Graphics.DrawRectangle(border,inf.Rct);//draw the border
				}
				else if (inf.Selected && !inf.Disabled)//unfolding tab appearance
				{
					lnbrs.LinearColors=_cols[0];//use band colors

					e.Graphics.FillRectangle(lnbrs,inf.Rct);//draw the background

					e.Graphics.DrawLines(border,new Point[]//draw a one-side-open reactangle
						{
							new Point(inf.Rct.X,inf.Rct.Bottom),
							new Point(inf.Rct.X,inf.Rct.Y),
							new Point(inf.Rct.Right,inf.Rct.Y),
							new Point(inf.Rct.Right,inf.Rct.Bottom)
						});
				}
				if (inf.Item.Text!="")//draw the text, no shortcut
				{
					SizeF sz;
					sz=e.Graphics.MeasureString(inf.Item.Text.Replace(@"&",""),//use no DefaultItem property
						e.Font);

					e.Graphics.DrawString(inf.Item.Text,e.Font,//draw the text
						inf.Disabled?Brushes.Gray:Brushes.Black,//grayed if the Item is disabled
						inf.Rct.X+(inf.Rct.Width-(int)sz.Width)/2,
						inf.Rct.Y+(inf.Rct.Height-(int)sz.Height)/2,fmt);
				}
				#endregion
			}
			else
			{
				#region draw background, margin and selection
				lnbrs.LinearColors=_cols[0];//use band colors

				lnbrs.Transform=new Matrix(_margin,0f,0f,1f,-1f,0f);//scale the brush

				e.Graphics.FillRectangle(lnbrs,0,inf.Rct.Y,_margin-2,inf.Rct.Height);//draw the band

				e.Graphics.FillRectangle(Brushes.White,_margin-2,inf.Rct.Y,//fill the backspace white
					2+inf.Rct.Width-_margin,inf.Rct.Height);

				if (inf.Item.Text=="-")//Item is a Separator
				{
					e.Graphics.DrawLine(new Pen(_cols[0][1]),//use the dark band color
						inf.Rct.X+_margin+2,inf.Rct.Y+inf.Rct.Height/2,
						inf.Rct.Right,inf.Rct.Y+inf.Rct.Height/2);
					return;
				}
				if (inf.Selected && !inf.Disabled)//item is hotlighted
				{
					hotbrs.Color=_cols[2][0];//use hotlight color

					e.Graphics.FillRectangle(hotbrs,//fill the background
						inf.Rct.X,inf.Rct.Y,inf.Rct.Width-1,inf.Rct.Height-1);

					e.Graphics.DrawRectangle(border,//draw the border
						inf.Rct.X,inf.Rct.Y,inf.Rct.Width-1,inf.Rct.Height-1);
				}
				#endregion
				#region draw chevron
				if (inf.Checked)//item is checked
				{
					hotbrs.Color=_cols[2][1];//use dark hot color

					e.Graphics.FillRectangle(hotbrs,//fill the background rect
						inf.Rct.X+1,inf.Rct.Y+1,inf.Rct.Height-3,inf.Rct.Height-3);
					e.Graphics.DrawRectangle(border,//draw the border
						inf.Rct.X+1,inf.Rct.Y+1,inf.Rct.Height-3,inf.Rct.Height-3);

					if (inf.Glyph==null)//if there is an image, no chevron will be drawed
					{
						e.Graphics.SmoothingMode=SmoothingMode.AntiAlias;//for a smooth form
						e.Graphics.PixelOffsetMode=PixelOffsetMode.HighQuality;

						if (!inf.Item.RadioCheck)//draw an check arrow
						{
							e.Graphics.FillPolygon(Brushes.Black,new Point[]
								{
									new Point(inf.Rct.X+7,inf.Rct.Y+10),
									new Point(inf.Rct.X+10,inf.Rct.Y+13),
									new Point(inf.Rct.X+15,inf.Rct.Y+8),

									new Point(inf.Rct.X+15,inf.Rct.Y+10),
									new Point(inf.Rct.X+10,inf.Rct.Y+15),
									new Point(inf.Rct.X+7,inf.Rct.Y+12)

								});
						}
						else//draw a circle
						{
							e.Graphics.FillEllipse(Brushes.Black,
								inf.Rct.X+8,inf.Rct.Y+8,7,7);
						}
						e.Graphics.SmoothingMode=SmoothingMode.Default;
					}
				}
				#endregion
				#region draw image
				if (inf.Glyph!=null)
				{
					if (!inf.Disabled)//draw image grayed
						e.Graphics.DrawImageUnscaled(inf.Glyph,
							inf.Rct.X+(inf.Rct.Height-inf.Glyph.Width)/2,
							inf.Rct.Y+(inf.Rct.Height-inf.Glyph.Height)/2);
					else
						ControlPaint.DrawImageDisabled(e.Graphics,inf.Glyph,
							inf.Rct.X+(inf.Rct.Height-inf.Glyph.Width)/2,
							inf.Rct.Y+(inf.Rct.Height-inf.Glyph.Height)/2,
							Color.Transparent);
				}
				#endregion
				#region draw text & shortcut

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
**性色生活片久久毛片| 日韩精品一区二区三区视频| ...中文天堂在线一区| 不卡av免费在线观看| 亚洲天堂网中文字| 欧美最新大片在线看| 五月天中文字幕一区二区| 日韩亚洲欧美在线观看| 国产一区二区三区香蕉| 欧美激情一区在线| 欧美影视一区在线| 美女mm1313爽爽久久久蜜臀| 久久精品亚洲国产奇米99| 成人av在线影院| 亚洲国产精品一区二区尤物区| 777色狠狠一区二区三区| 国产麻豆91精品| 国产精品视频第一区| 91美女精品福利| 日韩黄色一级片| 久久久久国色av免费看影院| 成人av在线一区二区| 日韩精品免费视频人成| 久久久九九九九| 在线国产电影不卡| 精品一区二区国语对白| 1区2区3区国产精品| 在线成人小视频| 国产91综合网| 香蕉乱码成人久久天堂爱免费| 久久久久久久久99精品| 欧美影视一区在线| 国产不卡高清在线观看视频| 亚洲一区二区三区四区在线观看| 精品国产3级a| 欧洲另类一二三四区| 国产精品 欧美精品| 午夜激情一区二区| 最新国产成人在线观看| 精品三级在线看| 欧美日韩一区二区在线观看| 成人av在线资源网| 成人h动漫精品一区二| 亚洲丰满少妇videoshd| 国产精品国产三级国产普通话99| 91精品国产综合久久久久久久| 成a人片亚洲日本久久| 经典三级在线一区| 亚洲成人手机在线| 日韩伦理电影网| 欧美激情在线免费观看| 日韩精品一区二区三区三区免费| 欧美性猛交xxxx黑人交| 91小视频免费观看| 成人精品免费看| 激情六月婷婷久久| 日韩av网站在线观看| 亚洲第一搞黄网站| 亚洲自拍欧美精品| 亚洲色图在线播放| 国产精品卡一卡二卡三| 26uuu另类欧美| 日韩美女视频一区二区在线观看| 欧美日韩亚洲综合一区二区三区| 色综合久久综合网欧美综合网| 国产成人在线免费| 国产精品一品视频| 国产乱色国产精品免费视频| 色噜噜狠狠成人网p站| 播五月开心婷婷综合| 国产成人精品www牛牛影视| 国产精品一区二区三区网站| 激情综合五月婷婷| 精品一区二区国语对白| 久久不见久久见免费视频1| 麻豆freexxxx性91精品| 精品在线免费观看| 精品亚洲国产成人av制服丝袜 | 亚洲一区二区三区四区不卡| 国产精品人成在线观看免费 | 色综合久久精品| 91免费精品国自产拍在线不卡| 99免费精品视频| 97超碰欧美中文字幕| 99国产精品国产精品毛片| 99久久精品免费看国产| 91福利国产成人精品照片| 欧洲人成人精品| 91麻豆精品国产91久久久使用方法| 欧美蜜桃一区二区三区| 欧美一区二区日韩| 久久奇米777| 中文字幕av不卡| 亚洲欧美日韩中文播放| 一个色综合网站| 青草av.久久免费一区| 精品一区二区三区在线播放| 国产经典欧美精品| 99精品欧美一区| 欧美亚洲一区二区三区四区| 欧美一级二级在线观看| 精品国产乱子伦一区| 中文字幕免费不卡在线| 亚洲一区二区在线免费看| 日本欧洲一区二区| 福利一区福利二区| 欧美中文字幕一二三区视频| 日韩午夜精品电影| 中文成人综合网| 亚洲小说欧美激情另类| 国产一区二区三区香蕉| 91国内精品野花午夜精品| 日韩精品专区在线影院观看| 国产偷国产偷精品高清尤物| 亚洲亚洲精品在线观看| 国产激情视频一区二区三区欧美| 一本到一区二区三区| 51午夜精品国产| 国产精品久久久99| 麻豆精品视频在线观看免费| 99国产精品一区| 日韩精品中文字幕在线不卡尤物| 中文字幕一区在线观看视频| 天天影视色香欲综合网老头| 成人av在线资源| 日韩欧美国产一区二区三区 | 午夜一区二区三区在线观看| 国产精品一区二区三区四区| 欧美在线视频全部完| 欧美激情一区二区三区全黄| 肉丝袜脚交视频一区二区| 盗摄精品av一区二区三区| 欧美一区二区三区电影| 亚洲免费观看高清| 国产91精品在线观看| 日韩欧美国产小视频| 亚洲综合色噜噜狠狠| 国产激情一区二区三区桃花岛亚洲| 欧美精品一级二级三级| 国产精品成人免费在线| 国产一区二区三区观看| 欧美日韩精品一区二区| 日韩一区在线播放| 成人精品免费网站| 久久蜜桃av一区二区天堂| 免费精品99久久国产综合精品| 欧洲av一区二区嗯嗯嗯啊| 日本一区二区不卡视频| 麻豆成人综合网| 日韩一级高清毛片| 午夜影视日本亚洲欧洲精品| 色欧美88888久久久久久影院| 国产农村妇女精品| 国产一区二区主播在线| 精品欧美乱码久久久久久| 日韩精品视频网| 91麻豆精品久久久久蜜臀| 亚洲一区二区欧美| 欧美三级在线视频| 性欧美大战久久久久久久久| 欧洲av在线精品| 亚洲国产精品久久人人爱| 欧美亚男人的天堂| 亚洲国产欧美在线人成| 日本韩国欧美三级| 樱花草国产18久久久久| 91美女视频网站| 亚洲黄色av一区| 欧美视频一二三区| 视频一区二区中文字幕| 欧美顶级少妇做爰| 美女www一区二区| 欧美videos中文字幕| 国产综合色精品一区二区三区| 欧美成人r级一区二区三区| 久久成人精品无人区| 久久精品一区四区| 成人国产精品免费| 亚洲特级片在线| 在线视频一区二区免费| 午夜久久久影院| 91精品福利在线一区二区三区| 蜜乳av一区二区| 久久亚洲精品国产精品紫薇| 国产91丝袜在线播放九色| 亚洲欧美中日韩| 欧美性一二三区| 久久精品国产在热久久| 国产午夜精品久久久久久免费视| av资源站一区| 亚洲一区二区三区四区在线免费观看 | 欧美大片一区二区| 精久久久久久久久久久| 国产精品久久久久久户外露出 | 日本一区二区久久| 91黄色激情网站| 美女精品一区二区| 国产精品久久午夜| 欧美日韩黄视频| 国产米奇在线777精品观看|