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

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

?? specialmenuprovider.cs

?? 汽車銷售公司ERP進銷存系統(tǒng) 汽車銷售公司ERP進銷存系統(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一区二区三区免费野_久草精品视频
国产尤物一区二区在线| 成人激情文学综合网| 国产自产v一区二区三区c| 国产成人精品影视| 欧美午夜精品一区| 国产色一区二区| 亚洲国产欧美在线人成| 成人精品高清在线| 欧美一级淫片007| 亚洲欧美日韩人成在线播放| 久久国内精品自在自线400部| 91蜜桃视频在线| 欧美一区二区网站| 亚洲影视在线播放| 韩国欧美国产一区| 555www色欧美视频| 一区二区三区波多野结衣在线观看 | 亚洲电影在线免费观看| 国产米奇在线777精品观看| 99久久精品国产麻豆演员表| 日韩一区二区视频在线观看| 有码一区二区三区| 91亚洲精华国产精华精华液| 国产精品福利一区| 国产成人h网站| 久久久久久日产精品| 美腿丝袜亚洲色图| 欧美一区二区三区性视频| 亚洲黄色尤物视频| 91尤物视频在线观看| 亚洲三级在线免费观看| av亚洲精华国产精华精| 国产欧美精品一区二区色综合朱莉| 制服丝袜中文字幕一区| 一区二区在线看| 91在线观看地址| 亚洲人123区| 色狠狠色狠狠综合| 亚瑟在线精品视频| 欧美一区在线视频| 久久疯狂做爰流白浆xx| 欧美电影免费观看高清完整版在线 | 亚洲精品美腿丝袜| 国产福利精品一区二区| 成人av在线影院| 国产精品久久久久桃色tv| 国产传媒一区在线| 中文成人av在线| 不卡一区二区三区四区| 亚洲男人都懂的| 欧美日韩一级视频| 日韩激情一区二区| 日韩精品在线网站| 国产精品自在欧美一区| 欧美国产激情一区二区三区蜜月| 中文字幕精品在线不卡| 成人av高清在线| 夜夜精品视频一区二区| 在线不卡的av| 久久精品国产99| 欧美激情一区在线| 在线视频观看一区| 日本一道高清亚洲日美韩| 欧美成人欧美edvon| 高清在线观看日韩| 亚洲欧美另类在线| 欧美一区二区女人| 国产精品2024| 一区二区免费在线| 欧美mv日韩mv国产网站| 成人美女视频在线看| 一区二区三区精品视频在线| 欧美人妖巨大在线| 国产91精品在线观看| 亚洲伦在线观看| 精品免费国产一区二区三区四区| 亚洲欧洲一区二区三区| 欧美日韩久久久一区| 国产一区二区视频在线| 亚洲精品久久嫩草网站秘色| 欧美一级欧美一级在线播放| 丰满放荡岳乱妇91ww| 午夜欧美在线一二页| 久久久99精品免费观看不卡| 欧美精三区欧美精三区| 成人精品在线视频观看| 午夜天堂影视香蕉久久| 136国产福利精品导航| 欧美成人一区二区三区| 欧美偷拍一区二区| 国产成人8x视频一区二区| 日本亚洲视频在线| 亚洲精品国产精华液| 国产午夜精品一区二区三区嫩草| 男人的天堂久久精品| 亚洲男女一区二区三区| 26uuu精品一区二区三区四区在线| 九九**精品视频免费播放| 亚洲欧美另类图片小说| 亚洲国产精品ⅴa在线观看| 欧美一区二区女人| 555www色欧美视频| 欧美三级视频在线播放| 91免费看片在线观看| 美女脱光内衣内裤视频久久网站| 欧美一区二区高清| 欧美精品日韩一本| 91国产成人在线| 色综合久久综合| 97久久超碰国产精品| 国产精品一区专区| 国产一区二区精品久久99| 狂野欧美性猛交blacked| 午夜影视日本亚洲欧洲精品| 一区二区三区四区蜜桃 | 国产一区二区免费在线| 日本伊人午夜精品| 青青草伊人久久| 麻豆国产精品视频| 美腿丝袜亚洲一区| 久久福利资源站| 国产精品一区三区| 韩国三级在线一区| 国产一区在线观看麻豆| 国产乱子伦一区二区三区国色天香| 欧美一区二区黄| 欧美成人video| 7777精品久久久大香线蕉| 91美女精品福利| 91浏览器在线视频| 99久久国产免费看| 成人免费毛片嘿嘿连载视频| 波多野结衣欧美| 色呦呦网站一区| 欧美区一区二区三区| 日韩视频中午一区| 国产亚洲精久久久久久| 亚洲精品免费视频| 天天av天天翘天天综合网 | 亚洲成人激情综合网| 午夜激情综合网| 麻豆精品视频在线观看免费| 日本女人一区二区三区| 久久99精品久久久久久国产越南 | 日韩欧美黄色影院| 欧美tk丨vk视频| 亚洲欧洲美洲综合色网| 亚洲精选一二三| 欧美xxx久久| 韩国av一区二区三区在线观看| 欧美一区二区播放| 欧美电影精品一区二区| 中文字幕一区二区三区在线播放| 色香蕉久久蜜桃| 欧美日韩国产乱码电影| 91精品国产全国免费观看| 精品国产在天天线2019| 国产日韩一级二级三级| 亚洲午夜久久久久中文字幕久| 日韩三级在线免费观看| 亚洲国产精品一区二区久久| 91天堂素人约啪| 国产精品护士白丝一区av| 精品一区二区三区免费毛片爱| 免费精品视频在线| 欧美在线免费观看视频| 亚洲女人的天堂| 粗大黑人巨茎大战欧美成人| 国产蜜臀97一区二区三区| 国产精品影音先锋| 《视频一区视频二区| eeuss国产一区二区三区| 亚洲午夜三级在线| 欧美一区二区视频在线观看2020 | 色哟哟日韩精品| 不卡一区二区在线| 5月丁香婷婷综合| 国产精品女人毛片| 久久国产婷婷国产香蕉| 大陆成人av片| 在线播放中文一区| 亚洲欧美色一区| 国产成人日日夜夜| 精品免费国产一区二区三区四区| 欧美电影免费观看高清完整版在| 日韩欧美一区在线观看| 洋洋av久久久久久久一区| 国产尤物一区二区在线| 日韩欧美精品在线视频| 亚洲chinese男男1069| 91免费观看国产| 中文字幕av一区二区三区| 国产一区欧美日韩| 亚洲精品在线观看视频| 日本v片在线高清不卡在线观看| 久久99国产精品久久99| 91麻豆精品国产91久久久资源速度 | 日韩欧美国产不卡| 亚洲高清视频的网址| 在线观看不卡一区|