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

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

?? specialmenuprovider.cs

?? 汽車銷售公司ERP進銷存系統 汽車銷售公司ERP進銷存系統
?? CS
?? 第 1 頁 / 共 2 頁
字號:
				SizeF sz;
				Font fnt=
					inf.Item.DefaultItem?new Font(e.Font,FontStyle.Bold):
					SystemInformation.MenuFont;//set font to BOLD if Item is a DefaultItem
				if (inf.Item.Text!="")
				{
					sz=e.Graphics.MeasureString(inf.Item.Text,fnt);//draw text
					e.Graphics.DrawString(inf.Item.Text,fnt,
						inf.Disabled?Brushes.Gray:Brushes.Black,
						inf.Rct.X+inf.Rct.Height+5,
						inf.Rct.Y+(inf.Rct.Height-(int)sz.Height)/2,fmt);
				}	
				if (inf.Item.Shortcut!=Shortcut.None && inf.Item.ShowShortcut)
				{
					string shc=GetShortcutString((Keys)inf.Item.Shortcut);

					sz=e.Graphics.MeasureString(shc,fnt);//draw shortcut
					e.Graphics.DrawString(shc,fnt,
						inf.Disabled?Brushes.Gray:Brushes.Black,
						inf.Rct.Right-(int)sz.Width-16,
						inf.Rct.Y+(inf.Rct.Height-(int)sz.Height)/2);
				}
				#endregion
			}
		}
		#endregion
		#region provideproperty::NewStyleActive
		/// <summary>
		/// Specifies wheter NewStyle-Drawing is enabled or not
		/// </summary>
		[Description("Specifies wheter NewStyle-Drawing is enabled or not")]
		[Browsable(false)]
		public bool GetNewStyleActive(MenuItem control) 
		{
			return true;//make sure every new item is selected
		}
		/// <summary>
		/// Specifies wheter NewStyle-Drawing is enabled or not
		/// </summary>
		public void SetNewStyleActive(MenuItem control, bool value) 
		{
			if (!value) 
			{
				if (_menuitems.Contains(control))//remove it from the collection
				{
					_menuitems.Remove(control);
				}
				//reset to system drawing
				control.OwnerDraw=false;
				control.MeasureItem-=new MeasureItemEventHandler(control_MeasureItem);
				control.DrawItem-=new DrawItemEventHandler(control_DrawItem);
			}
			else 
			{
				//add it or change the value
				if (!_menuitems.Contains(control))
					_menuitems.Add(control,new MenuItemInfo(true,null));
				else
					((MenuItemInfo)_menuitems[control]).NewStyle=true;
				//set to owner drawing
				control.OwnerDraw=true;
				control.MeasureItem+=new MeasureItemEventHandler(control_MeasureItem);
				control.DrawItem+=new DrawItemEventHandler(control_DrawItem);
			}
		}
		#endregion
		#region provideproperty::MenuGlyph
		/// <summary>
		/// Specifies the image displayed next to the MenuItem
		/// </summary>
		[Description("Specifies the image displayed next to the MenuItem")]
		[DefaultValue(null)]
		public Image GetMenuGlyph(MenuItem control) 
		{
			MenuItemInfo ret=(MenuItemInfo)_menuitems[control];
			if (ret==null) return null;
			return ret.Glyph;
		}
		/// <summary>
		/// Specifies the image displayed next to the MenuItem
		/// </summary>
		public void SetMenuGlyph(MenuItem control, Image value) 
		{
			if (value==null) 
			{
				if (_menuitems.Contains(control))//set the image property in the collection to NULL
				{
					((MenuItemInfo)_menuitems[control]).Glyph=null;
					if(((MenuItemInfo)_menuitems[control]).NewStyle==false)
						_menuitems.Remove(control);
				}			
			}
			else 
			{
				//add the MenuItem to the collection or change the image value
				if (!_menuitems.Contains(control))
				{
					_menuitems.Add(control,new MenuItemInfo(true,value));
					control.OwnerDraw=true;
					control.MeasureItem+=new MeasureItemEventHandler(control_MeasureItem);
					control.DrawItem+=new DrawItemEventHandler(control_DrawItem);
				}
				else
					((MenuItemInfo)_menuitems[control]).Glyph=value;
					
			}
		}
		#endregion

		#region hooker
		[Browsable(false)]
		public Form OwnerForm
		{
			get{return _owner;}
			set
			{
				if (_hook!=IntPtr.Zero)//uninstall hook
				{
					Win32.UnhookWindowsHookEx(_hook);
					_hook=IntPtr.Zero;
				}
				_owner = value;
				if (_owner != null)
				{
					if (_hookprc == null)
					{
						_hookprc = new Win32.HookProc(OnHookProc);
					}
					_hook = Win32.SetWindowsHookEx(Win32.WH_CALLWNDPROC,//install hook
						_hookprc, IntPtr.Zero, Win32.GetWindowThreadProcessId(_owner.Handle, 0));
				}
			}
		}
		/// <summary>
		/// process all message posted to the application
		/// </summary>
		private int OnHookProc(int code, IntPtr wparam, ref Win32.CWPSTRUCT cwp)
		{
			if (code == 0)
			{
				switch (cwp.message)
				{
					case Win32.WM_CREATE://a window is created
					{
						StringBuilder builder1 = new StringBuilder(0x40);
						int num2 = Win32.GetClassName(cwp.hwnd, builder1, builder1.Capacity);
						string text1 = builder1.ToString();
						if (string.Compare(text1,"#32768",false) == 0)//test if the class name
							//identifies the control as a MenuItem
						{
							this.lastHook = new MenuHook(this,_lastwidth);
							this.lastHook.AssignHandle(cwp.hwnd);
							_lastwidth=0;
							/*
							 * We don't use a local variable, because the GC
							 * would destroy it immediately afte leaving the
							 * function. Instead we use one private variable
							 * ,because there's always only  one ContextMenu
							 * on the  Desktop and  the Hooker is  destroyed
							 * when another ContextMenu lights up.
							 */
						}
						break;
					}
					case Win32.WM_DESTROY://owner is destroyed, unhook all
					{
						if ((cwp.hwnd == _owner.Handle) && _hook!=IntPtr.Zero)
						{
							Win32.UnhookWindowsHookEx(_hook);
							_hook = IntPtr.Zero;
						}
						break;
					}
				}
			}
			return Win32.CallNextHookEx(_hook, code, wparam, ref cwp);
		}
		#endregion
		#region helper
		/// <summary>
		/// gets the brush to draw the image-band next to each menuitem
		/// </summary>
		[Browsable(false)]
		public LinearGradientBrush MarginBrush
		{
			get
			{
				lnbrs.LinearColors=_cols[0];
				lnbrs.Transform=new Matrix(_margin,0f,0f,1f,1f,0f);
				return lnbrs;
			}
		}
		/// <summary>
		/// gets the width of the image-band next to each menuitem
		/// </summary>
		[Browsable(false)]
		public int MarginWidth
		{
			get{return _margin;}
		}
		/// <summary>
		/// returns the Pen used to paint the border of a menuitem
		/// </summary>
		[Browsable(false)]
		public Pen BorderPen
		{
			get{return border;}
		}
		private string GetShortcutString(Keys shortcut)
		{
			return TypeDescriptor.GetConverter(typeof(Keys))
				.ConvertToString(shortcut);
		}
		#endregion
		#region public properties
		/// <summary>
		/// the color of the border of the selection frame and the popup menu itself
		/// </summary>
		[DefaultValue(typeof(Color),"0,0,128")]
		[Category("Colors")]
		[Description("the color of the border of the selection frame and the popup menu itself")]
		public Color BorderColor
		{
			get{return border.Color;}
			set{border.Color=Color.FromArgb(255,value);}
		}
		/// <summary>
		/// specifies the lighter color of a preselected menuitem
		/// </summary>
		[DefaultValue(typeof(Color),"255,244,204")]
		[Category("Colors")]
		[Description("specifies the lighter color of a preselected menuitem")]
		public Color HotLightGradientLight
		{
			get{return _cols[2][0];}
			set{_cols[2][0]=Color.FromArgb(255,value);}
		}
		/// <summary>
		/// specifies the darker color of a preselected menuitem
		/// </summary>
		[DefaultValue(typeof(Color),"255,214,154")]
		[Category("Colors")]
		[Description("specifies the darker color of a preselected menuitem")]
		public Color HotLightGradientDark
		{
			get{return _cols[2][1];}
			set{_cols[2][1]=Color.FromArgb(255,value);}
		}
		/// <summary>
		/// the color on the right side of a mainmenu
		/// </summary>
		[DefaultValue(typeof(Color),"195,218,249")]
		[Category("Colors")]
		[Description("the color on the right side of a mainmenu")]
		public Color BandGradientLight
		{
			get{return _cols[1][0];}
			set{_cols[1][0]=Color.FromArgb(255,value);}
		}
		/// <summary>
		/// the color on the left side of a mainmenu
		/// </summary>
		[DefaultValue(typeof(Color),"158,190,245")]
		[Category("Colors")]
		[Description("the color on the left side of a mainmenu")]
		public Color BandGradientDark
		{
			get{return _cols[1][1];}
			set{_cols[1][1]=Color.FromArgb(255,value);}
		}
		/// <summary>
		/// sets or gets the lighter color of the image-band next to each menuitem
		/// </summary>
		[DefaultValue(typeof(Color),"227,239,255")]
		[Category("Colors")]
		[Description("sets or gets the lighter color of the image-band next to each menuitem")]
		public Color ItemGradientLight
		{
			get{return _cols[0][0];}
			set{_cols[0][0]=Color.FromArgb(255,value);}
		}
		/// <summary>
		/// sets or gets the darker color of the image-band next to each menuitem
		/// </summary>
		[DefaultValue(typeof(Color),"135,173,228")]
		[Category("Colors")]
		[Description("sets or gets the darker color of the image-band next to each menuitem")]
		public Color ItemGradientDark
		{
			get{return _cols[0][1];}
			set{_cols[0][1]=Color.FromArgb(255,value);}
		}
		#endregion
	}
	/// <summary>
	/// This class is used to hook the events posted to a context/popup menu
	/// </summary>
	internal class MenuHook:NativeWindow
	{
		#region variablen
		private SpecialMenuProvider _parent=null;
		private int _lastwidth=0;
		#endregion
		public MenuHook(SpecialMenuProvider parent, int lastwidth)
		{
			if (parent==null)
				throw new ArgumentNullException();//parent property mustn't be NULL
			_parent=parent;//MenuExtender with drawing paramenters
			_lastwidth=lastwidth;//width of the topItem unfolding the Menu or 0
		}
		#region controller
		/// <summary>
		/// Hook window messages of a context/popup menu
		/// </summary>
		/// <param name="m">windows message</param>
		protected override void WndProc(ref Message m)
		{
			switch(m.Msg)
			{
				case Win32.WM_NCPAINT://menu unfolding
				{
					IntPtr windc = Win32.GetWindowDC(m.HWnd);
					Graphics gr = Graphics.FromHdc(windc);
					this.DrawBorder(gr);
					Win32.ReleaseDC(m.HWnd, windc);
					gr.Dispose();
					m.Result = IntPtr.Zero;
					break;
				}
				case Win32.WM_PRINT://user presses 'PRINT'
				{
					base.WndProc(ref m);
					IntPtr dc = m.WParam;
					Graphics gr = Graphics.FromHdc(dc);
					this.DrawBorder(gr);
					Win32.ReleaseDC(m.HWnd, dc);
					gr.Dispose();
					break;
				}
				default:
				{
					base.WndProc(ref m);
					break;
				}
			}
		}
		#endregion
		/// <summary>
		/// This draws the missing parts in the margin of a menuitem
		/// </summary>
		/// <param name="gr">the graphics surface to draw on</param>
		private void DrawBorder(Graphics gr)
		{
			//calculate the space of the context/popup menu
			Rectangle clip=Rectangle.Round(gr.VisibleClipBounds);
			clip.Width--; clip.Height--;

			int margin=_parent.MarginWidth;
			//fill the missing gradient parts using extender's brush
			gr.FillRectangle(_parent.MarginBrush,clip.X+1,clip.Y+1,2,clip.Height-2);
			gr.FillRectangle(_parent.MarginBrush,clip.X+1,clip.Y+1,margin,2);
			gr.FillRectangle(_parent.MarginBrush,clip.X+1,clip.Bottom-2,margin,2);

			//fill the other edges white, so using old windows style will not change the appearance
			gr.FillRectangle(Brushes.White,clip.X+margin+1,clip.Y+1,clip.Width-margin-1,2);
			gr.FillRectangle(Brushes.White,clip.X+margin+1,clip.Bottom-2,clip.Width-margin-1,2);
			gr.FillRectangle(Brushes.White,clip.Right-2,clip.Y+1,2,clip.Height);

			//draw the border with a little white line on the top,
			//then it looks like a tab unfolding.
			//in contextmenus: _lastwidth==0
			gr.DrawLine(Pens.White,clip.X+1,clip.Y,clip.X+_lastwidth-2,clip.Y);
			gr.DrawLine(_parent.BorderPen,clip.X,clip.Y,clip.X,clip.Bottom);
			gr.DrawLine(_parent.BorderPen,clip.X,clip.Bottom,clip.Right,clip.Bottom);
			gr.DrawLine(_parent.BorderPen,clip.Right,clip.Bottom,clip.Right,clip.Y);
			gr.DrawLine(_parent.BorderPen,clip.Right,clip.Y,clip.X+_lastwidth-1,clip.Y);
		}
	}
	/// <summary>
	/// This class provides static access to some Win32 API
	/// </summary>
	internal abstract class Win32
	{
		[DllImport("user32.dll", CharSet=CharSet.Ansi, SetLastError=true, ExactSpelling=true)]
		public static extern int CallNextHookEx(IntPtr hookHandle, int code, IntPtr wparam, ref CWPSTRUCT cwp);
		[DllImport("user32.dll", EntryPoint="GetClassNameA", CharSet=CharSet.Ansi, SetLastError=true, ExactSpelling=true)]
		public static extern int GetClassName(IntPtr hwnd, StringBuilder className, int maxCount);
		[DllImport("user32", CharSet=CharSet.Ansi, SetLastError=true, ExactSpelling=true)]
		public static extern IntPtr GetWindowDC(IntPtr hwnd);
		[DllImport("user32.dll", CharSet=CharSet.Ansi, SetLastError=true, ExactSpelling=true)]
		public static extern int GetWindowThreadProcessId(IntPtr hwnd, int ID);
		[DllImport("user32", CharSet=CharSet.Ansi, SetLastError=true, ExactSpelling=true)]
		public static extern IntPtr ReleaseDC(IntPtr hwnd, IntPtr hdc);
		[DllImport("user32.dll", EntryPoint="SetWindowsHookExA", CharSet=CharSet.Ansi, SetLastError=true, ExactSpelling=true)]
		public static extern IntPtr SetWindowsHookEx(int type, HookProc hook, IntPtr instance, int threadID);
		[DllImport("user32.dll", CharSet=CharSet.Ansi, SetLastError=true, ExactSpelling=true)]
		public static extern bool UnhookWindowsHookEx(IntPtr hookHandle);

		public const int WH_CALLWNDPROC = 4;
		public const int WM_CREATE = 1;
		public const int WM_DESTROY = 2;
		public const int WM_NCPAINT = 0x85;
		public const int WM_PRINT = 0x317;

		[StructLayout(LayoutKind.Sequential)]
			public struct CWPSTRUCT
		{
			public IntPtr lparam;
			public IntPtr wparam;
			public int message;
			public IntPtr hwnd;
		}

		public delegate int HookProc(int code, IntPtr wparam, ref Win32.CWPSTRUCT cwp);
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美网站一区二区| 日韩欧美精品在线视频| 一区视频在线播放| 成人精品电影在线观看| 国产亚洲综合在线| 国产一区二区导航在线播放| 精品国产一二三| 久久99国产精品久久| 日韩一级精品视频在线观看| 日韩国产欧美一区二区三区| 制服丝袜在线91| 日本成人在线看| 欧美刺激脚交jootjob| 美女被吸乳得到大胸91| 欧美一区二区精品在线| 奇米在线7777在线精品| 日韩欧美激情一区| 奇米影视一区二区三区| 精品乱码亚洲一区二区不卡| 久久99久久久欧美国产| 久久这里只有精品首页| 国产成人av自拍| 国产精品视频免费看| 99国产一区二区三精品乱码| 亚洲欧美偷拍卡通变态| 色香色香欲天天天影视综合网| 亚洲自拍偷拍欧美| 91精品久久久久久久99蜜桃| 奇米色777欧美一区二区| 久久综合五月天婷婷伊人| 春色校园综合激情亚洲| 自拍偷拍亚洲综合| 欧美日韩国产精品成人| 日韩av电影免费观看高清完整版| 日韩精品在线看片z| 国产精品99久| 亚洲欧美日韩电影| 555www色欧美视频| 国产精品资源在线看| 国产精品福利影院| 欧美日韩国产在线播放网站| 蜜桃av噜噜一区| 精品福利一二区| 91影院在线观看| 午夜影院久久久| 精品国产一区二区精华| 波多野结衣亚洲一区| 亚洲一二三级电影| 欧美精品一区男女天堂| 9色porny自拍视频一区二区| 亚洲mv在线观看| 久久久久青草大香线综合精品| 波多野洁衣一区| 日韩av不卡在线观看| 欧美国产激情二区三区| 欧美自拍丝袜亚洲| 国产美女精品在线| 一区2区3区在线看| 日韩精品一区二区三区中文不卡 | 久久蜜桃一区二区| 99久久99久久精品免费观看| 日韩专区一卡二卡| 欧美激情自拍偷拍| 欧美日本视频在线| 欧美一区二区三区视频免费| 福利一区福利二区| 无码av免费一区二区三区试看| 国产午夜精品美女毛片视频| 欧美三级日韩在线| 国产91精品久久久久久久网曝门 | 韩国女主播一区二区三区| 亚洲色欲色欲www| 精品乱码亚洲一区二区不卡| 91麻豆精品在线观看| 国模大尺度一区二区三区| 一二三四区精品视频| 久久综合久久久久88| 欧美中文字幕久久| 国产aⅴ精品一区二区三区色成熟| 亚洲福利视频三区| 国产精品女主播av| 欧美成人aa大片| 欧美综合一区二区| 成年人午夜久久久| 精品一区二区三区在线视频| 夜夜嗨av一区二区三区网页| 国产夜色精品一区二区av| 这里只有精品视频在线观看| 99re亚洲国产精品| 国产精品自拍网站| 美女视频一区二区三区| 亚洲一区二区三区四区五区中文| 久久久久国产成人精品亚洲午夜| 在线成人av网站| 欧美亚洲一区二区三区四区| 床上的激情91.| 国产一区日韩二区欧美三区| 日韩av午夜在线观看| 亚洲自拍偷拍综合| 亚洲欧美在线视频| 国产日韩欧美一区二区三区乱码| 日韩午夜激情av| 欧美高清一级片在线| 在线观看日韩国产| 色又黄又爽网站www久久| 处破女av一区二区| 国产精品综合av一区二区国产馆| 麻豆一区二区三区| 日本aⅴ精品一区二区三区| 亚洲成av人片一区二区三区| 亚洲男女一区二区三区| 综合久久久久久| 亚洲欧洲三级电影| 国产精品视频在线看| 国产偷v国产偷v亚洲高清| 久久久一区二区三区捆绑**| 日韩免费成人网| 日韩女优视频免费观看| 91精品国产91久久综合桃花| 欧美精品久久99| 欧美区在线观看| 欧美日韩一卡二卡三卡| 欧美日韩免费一区二区三区视频| 欧美在线免费播放| 日本乱人伦aⅴ精品| 一本一道波多野结衣一区二区| 波多野洁衣一区| www.性欧美| 色网站国产精品| 欧美视频三区在线播放| 色系网站成人免费| 色综合久久精品| 在线精品视频小说1| 欧美亚洲动漫精品| 欧美理论在线播放| 日韩一级大片在线| 欧美不卡一区二区| 久久色在线观看| 欧美激情综合五月色丁香小说| 亚洲国产精品黑人久久久 | 精品美女一区二区| 亚洲精品一区二区三区在线观看| 精品久久一区二区三区| 久久亚洲影视婷婷| 国产精品久久福利| 亚洲乱码一区二区三区在线观看| 亚洲精品亚洲人成人网| 亚洲成人av资源| 久久超碰97中文字幕| 日韩视频在线一区二区| 欧美成人三级在线| 国产日韩精品一区| 亚洲天堂中文字幕| 亚洲国产另类av| 裸体健美xxxx欧美裸体表演| 国产麻豆午夜三级精品| www.成人在线| 在线一区二区视频| 日韩一级二级三级精品视频| 久久久久久久久久久电影| 国产精品嫩草99a| 亚洲一区二区三区四区不卡| 美女网站视频久久| 丁香桃色午夜亚洲一区二区三区| 99国内精品久久| 欧美高清精品3d| 久久久久久一二三区| 亚洲人成伊人成综合网小说| 五月天丁香久久| 国产馆精品极品| 欧洲日韩一区二区三区| 欧美成人一区二区三区片免费| 国产精品视频在线看| 亚洲成人动漫精品| 国产电影一区在线| 欧美综合在线视频| 久久久综合九色合综国产精品| 亚洲精品视频在线观看网站| 热久久免费视频| 粉嫩高潮美女一区二区三区| 欧美色倩网站大全免费| 亚洲精品一区二区三区蜜桃下载| 亚洲视频一区在线观看| 日韩二区三区在线观看| 成人网页在线观看| 欧美精品丝袜中出| 国产精品国产三级国产三级人妇| 午夜天堂影视香蕉久久| 国产精品自拍在线| 欧美美女黄视频| 国产精品电影院| 奇米一区二区三区av| 99视频在线精品| 欧美va亚洲va香蕉在线| 亚洲日本va在线观看| 狠狠色丁香久久婷婷综合_中| 色综合咪咪久久| 久久丝袜美腿综合| 无码av中文一区二区三区桃花岛| 波多野结衣在线一区|