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

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

?? officemenus.cs

?? 我把以前寫的 C# 版的Rose 共享出來供別人學(xué)習(xí)參考。很具有學(xué)習(xí)參考價值主要涉及 GDI+ ,軟件架構(gòu)
?? CS
字號:
// *****************************************************************************
//  Copyright 2004, 王興(wangxing)
//  All rights reserved. The software and associated documentation 
//  supplied hereunder are the proprietary information of  wxohyer
//  對代碼的任何更改需要經(jīng)過必須經(jīng)過本人同意
//  I'm 99  Author:王興(wangxing)   MSN:wxohyer@hotmail.com  QQ:59294081
// *****************************************************************************
using System;
using System.ComponentModel;
using System.Collections;
using System.Collections.Specialized;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.Windows.Forms;


namespace  UML.Design.Components
{
	/// <summary>
	/// Summary description for OfficeMenus.
	/// </summary>
	[ToolboxBitmap (typeof(OfficeMenus), "Dev4Arabs.OfficeMenus.bmp")]
	public class OfficeMenus : System.ComponentModel.Component
	{
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		static ImageList _imageList;

		// Collection that holds the pictures details
		static NameValueCollection picDetails = new NameValueCollection();

		public OfficeMenus(System.ComponentModel.IContainer container)
		{
			///
			/// Required for Windows.Forms Class Composition Designer support
			///
			container.Add(this);
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		public OfficeMenus()
		{
			///
			/// Required for Windows.Forms Class Composition Designer support
			///
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

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

		#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()
		{
			components = new System.ComponentModel.Container();
		}
		#endregion

		/// <summary>
		/// This method start the proccess of changing the
		/// menus look to that of Office 2003
		/// </summary>
		/// <param name="form"></param>
		public void Start(Form form)
		{
			try 
			{
				//************************************
				// Main menu
				//************************************
				
				// Get the main menu from the parent form
				System.Windows.Forms.MainMenu menu = form.Menu;

				// loop through all MenuItem controls, adding the event handlers
				foreach ( MenuItem mi in menu.MenuItems )
				{
					// Add MesaureItem event handler
					mi.MeasureItem += new System.Windows.Forms.MeasureItemEventHandler(mainMenuItem_MeasureItem);
					// Add DrawItem event handler
					mi.DrawItem += new System.Windows.Forms.DrawItemEventHandler(mainMenuItem_DrawItem);
					// Set the OwnerDraw property to true
					mi.OwnerDraw = true;
					
					// call InitMenuItem Method to apply changes to child menus
					InitMenuItem(mi);
				}

				//**************************************
				// Context menus
				//**************************************

				// Parent Form context menu
				ContextMenu cmenu = form.ContextMenu;
				if ( cmenu != null ) {
					InitMenuItem(cmenu);
				}

				// Now all context menus for all controls in the Form
				foreach ( Control c in form.Controls ) 
				{
					if ( c.ContextMenu != null )
						InitMenuItem(c.ContextMenu);
				}

			}
			catch {}
		}

		/// <summary>
		/// This method Ends the proccess of changing the
		/// menus look to that of Office 2003
		/// </summary>
		/// <param name="form"></param>
		public void End(Form form)
		{
			try 
			{
				//************************************
				// Main menu
				//************************************
				
				// Get the main menu from the parent form
				System.Windows.Forms.MainMenu menu = form.Menu;

				// loop through all MenuItem controls, Removing the event handlers
				foreach ( MenuItem mi in menu.MenuItems )
				{
					// Remove MesaureItem event handler
					mi.MeasureItem -= new System.Windows.Forms.MeasureItemEventHandler(mainMenuItem_MeasureItem);
					// Remove DrawItem event handler
					mi.DrawItem -= new System.Windows.Forms.DrawItemEventHandler(mainMenuItem_DrawItem);
					// Set the OwnerDraw property to false
					mi.OwnerDraw = false;
					
					// call UninitMenuItem Method to Remove changes from child menus
					UninitMenuItem(mi);
				}

				//**************************************
				// Context menus
				//**************************************

				// Parent Form context menu
				ContextMenu cmenu = form.ContextMenu;
				if ( cmenu != null ) 
				{
					UninitMenuItem(cmenu);
				}

				// Now all context menus for all controls in the Form
				foreach ( Control c in form.Controls ) 
				{
					if ( c.ContextMenu != null )
						UninitMenuItem(c.ContextMenu);
				}

			}
			catch {}
		}

		/// <summary>
		/// This method add event handlers to MesaureItem event and 
		/// DrawItem event, and changed the OwnerDraw property to true.
		/// after calling this method for a menu, the menu will look like 
		/// Office 2003 menus
		/// </summary>
		/// <param name="mi">The Menu to apply changes for</param>
		private void InitMenuItem(Menu mi)
		{
			foreach ( MenuItem m in mi.MenuItems )
			{
				// Add MesaureItem event handler
				m.MeasureItem += 
					new System.Windows.Forms.MeasureItemEventHandler(this.menuItem_MeasureItem);
				// Add DrawItem event handler
				m.DrawItem += 
					new System.Windows.Forms.DrawItemEventHandler(this.menuItem_DrawItem);
				// Set the OwnerDraw property to true
				m.OwnerDraw = true;

				// Recall the same method again to apply the changes
				// to the child menus
				InitMenuItem(m);
			}
		}

		/// <summary>
		/// This method Remove all changes to the menus
		/// </summary>
		/// <param name="mi">the menu too remove changes from</param>
		private void UninitMenuItem(Menu mi)
		{
			foreach ( MenuItem m in mi.MenuItems )
			{
				// Remove MesaureItem event handler
				m.MeasureItem -= 
					new System.Windows.Forms.MeasureItemEventHandler(this.menuItem_MeasureItem);
				// Remove DrawItem event handler
				m.DrawItem -= 
					new System.Windows.Forms.DrawItemEventHandler(this.menuItem_DrawItem);
				// Set the OwnerDraw property to false
				m.OwnerDraw = false;

				// Recall the same method again to Remove the changes
				// from the child menus
				UninitMenuItem(m);
			}
		}

		/// <summary>
		/// This is the event for mesauring the MenuItem size
		/// this will only be added for MenuItems and ContextMenus
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void menuItem_MeasureItem(object sender, System.Windows.Forms.MeasureItemEventArgs e)
		{
			MenuItem mi = (MenuItem) sender;
			// if the item is a seperator
			if ( mi.Text == "-" ) {
				e.ItemHeight = 7;
			} else {
				// get the item's text size
				SizeF miSize = e.Graphics.MeasureString(mi.Text, Globals.menuFont);
				int scWidth = 0;
				// get the short cut width
				if ( mi.Shortcut != Shortcut.None ) {
					SizeF scSize = e.Graphics.MeasureString(mi.Shortcut.ToString(), Globals.menuFont);
					scWidth = Convert.ToInt32(scSize.Width);
				}
				// set the bounds
				int miHeight = Convert.ToInt32(miSize.Height) + 7;
				if (miHeight < 25) miHeight = Globals.MIN_MENU_HEIGHT;
				e.ItemHeight = miHeight;
				e.ItemWidth = Convert.ToInt32(miSize.Width) + scWidth + (Globals.PIC_AREA_SIZE * 2);
			}
		}

		/// <summary>
		/// The event for drawing menuItems, this will be called for
		/// MenuItems and ContextMenus
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void menuItem_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e)
		{
			// Draw Menu Item
			MenuItemDrawing.DrawMenuItem(e, (MenuItem) sender);
		}

		/// <summary>
		/// This is the event for mesauring the MenuItem size
		/// this will only be added for Main MenuItems
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void mainMenuItem_MeasureItem(object sender, System.Windows.Forms.MeasureItemEventArgs e)
		{
			MenuItem mi = (MenuItem) sender;
			SizeF miSize = e.Graphics.MeasureString(mi.Text, Globals.menuFont);
			e.ItemWidth = Convert.ToInt32(miSize.Width);
		}

		/// <summary>
		/// The event for drawing menuItems, this will only be called for
		/// Main MenuItems
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void mainMenuItem_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e)
		{
			// Draw the main menu item
			MainMenuItemDrawing.DrawMenuItem(e, (MenuItem) sender);
		}

		// ************************************
		// Public Methods
		// ************************************
		/// <summary>
		/// Adds a picture to a MenuItem
		/// </summary>
		/// <param name="mi">The menuItem to add picture to</param>
		/// <param name="index">The index of the Picture in the ImageList</param>
		public void AddPicture(MenuItem mi, int index)
		{
			picDetails.Add(mi.Handle.ToString(), index.ToString());
		}

		/// <summary>
		/// Gets a MenuItem's Picure
		/// </summary>
		/// <param name="mi">The MenuItem to get it's picture</param>
		/// <returns>A Bitmap object contains the picture
		/// null in case no picture for this MenuItem
		/// </returns>
		public static Bitmap GetItemPicture(MenuItem mi)
		{
			if ( _imageList == null )
				return null;

			string [] picIndex = picDetails.GetValues(mi.Handle.ToString());
			
			if ( picIndex == null )
				return null;
			else
				return (Bitmap)_imageList.Images[Convert.ToInt32(picIndex[0])];
		}

		//*************************************
		// Public Properties
		//*************************************
		/// <summary>
		/// The ImageList which will hold the MenuItems pictures
		/// </summary>
		public ImageList ImageList
		{
			get { return _imageList; }
			set { _imageList = value; }
		}
	}
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品黑人性xxxx| 亚洲激情一二三区| 中文字幕中文乱码欧美一区二区| 一区二区三区产品免费精品久久75| 日韩精品免费专区| 成人伦理片在线| 91精品国产乱码久久蜜臀| 中文字幕日本乱码精品影院| 日韩成人av影视| 色丁香久综合在线久综合在线观看| 欧美成人一区二区| 亚洲曰韩产成在线| 99精品视频一区二区三区| 日韩一区二区三区精品视频| 一区二区三区中文字幕精品精品 | 91激情五月电影| 久久丝袜美腿综合| 国产 日韩 欧美大片| 日韩欧美区一区二| 日韩高清一区二区| 欧美自拍丝袜亚洲| 亚洲欧美另类图片小说| 不卡视频在线观看| 国产欧美日韩一区二区三区在线观看 | 国产精品福利一区二区三区| 黄色资源网久久资源365| 91麻豆精品国产91久久久久久 | 国产在线精品免费| 欧美一区二区在线观看| 图片区日韩欧美亚洲| 在线亚洲精品福利网址导航| 亚洲美女淫视频| 99久久精品情趣| 日韩理论片一区二区| 99视频一区二区三区| 亚洲色图制服丝袜| 色88888久久久久久影院按摩| 亚洲欧洲色图综合| 91丨九色porny丨蝌蚪| 国产精品国产三级国产有无不卡| 国产aⅴ综合色| 中文成人综合网| 91麻豆6部合集magnet| 亚洲欧美一区二区三区孕妇| 色婷婷av一区二区三区gif| 亚洲码国产岛国毛片在线| 91黄色免费观看| 视频一区二区三区在线| 日韩欧美区一区二| 国产一区二区三区免费| 国产精品嫩草99a| 色综合久久天天综合网| 亚洲午夜视频在线| 欧美一三区三区四区免费在线看| 免费欧美高清视频| 久久久精品免费免费| 99久久综合精品| 亚洲成人免费在线观看| 日韩三级在线免费观看| 懂色av中文字幕一区二区三区| 国产精品福利在线播放| 精品视频一区二区三区免费| 久久66热偷产精品| 国产精品亲子伦对白| 在线一区二区观看| 日本中文字幕一区二区视频| 欧美极品美女视频| 欧美日韩小视频| 国产一区二区三区av电影 | 26uuu欧美| 99国产精品久久久久久久久久久 | 狠狠网亚洲精品| 亚洲少妇30p| 精品国产乱码久久久久久蜜臀| 成人动漫av在线| 东方欧美亚洲色图在线| 亚洲欧美aⅴ...| 精品国产一区二区精华| 色先锋久久av资源部| 九九久久精品视频| 亚洲综合图片区| 国产午夜亚洲精品羞羞网站| 欧美熟乱第一页| 成人免费观看视频| 美腿丝袜亚洲综合| 亚洲一区在线观看网站| 欧美精彩视频一区二区三区| 91麻豆精品国产91久久久久久| 成人高清av在线| 国产原创一区二区三区| 天堂在线亚洲视频| 亚洲精品国产成人久久av盗摄 | 久久精品国产**网站演员| 亚洲视频一区二区在线| 久久久一区二区三区| 制服丝袜中文字幕亚洲| 91美女视频网站| 成人午夜短视频| 激情综合网最新| 日韩精品三区四区| 亚洲福利电影网| 一区二区三区在线视频观看 | 欧美一区二区三级| 色婷婷av一区二区三区之一色屋| 国产不卡视频一区| 国内精品视频666| 麻豆成人久久精品二区三区小说| 香蕉乱码成人久久天堂爱免费| 亚洲精品国产精品乱码不99| 国产精品福利影院| 国产精品色婷婷久久58| 国产亚洲欧美日韩日本| 久久欧美中文字幕| 精品久久99ma| 久久免费视频色| 久久精品在线观看| 久久久综合精品| 国产欧美日韩精品一区| 久久精品欧美日韩| 亚洲国产精品国自产拍av| 亚洲精品五月天| 亚洲一级不卡视频| 亚洲国产精品久久一线不卡| 亚洲成人免费在线| 欧美96一区二区免费视频| 青青草国产成人av片免费| 奇米精品一区二区三区四区| 蜜臀久久99精品久久久画质超高清| 亚洲成人中文在线| 日本不卡一二三| 国产一区视频在线看| 国产成都精品91一区二区三| 91在线精品一区二区| 在线一区二区视频| 91精品国产日韩91久久久久久| 欧美变态口味重另类| 久久久久亚洲蜜桃| 亚洲欧洲一区二区在线播放| 亚洲综合丁香婷婷六月香| 水野朝阳av一区二区三区| 国产精品久久看| 97久久人人超碰| 欧美日韩精品一区视频| 日韩精品一区二区在线| 国产精品久久福利| 午夜精品在线看| 国产九九视频一区二区三区| 91丨porny丨首页| 宅男噜噜噜66一区二区66| 久久久久高清精品| 亚洲美腿欧美偷拍| 久久国产剧场电影| 91同城在线观看| 欧美videossexotv100| 亚洲欧洲av色图| 秋霞国产午夜精品免费视频| jizz一区二区| 日韩一区二区三区视频在线观看| 中文字幕中文在线不卡住| 日韩av中文字幕一区二区三区| 成人免费电影视频| 91精品福利在线一区二区三区| 国产精品女人毛片| 天天综合色天天综合色h| 岛国av在线一区| 日韩午夜激情av| 一区二区三区成人| 国产不卡视频一区二区三区| 91精品免费观看| 亚洲精品中文字幕乱码三区 | 国产乱子轮精品视频| 欧美日韩中文精品| 国产精品乱人伦中文| 久久国产日韩欧美精品| 在线观看欧美精品| 中文字幕在线不卡| 国产一区二区调教| 91精品欧美久久久久久动漫| 亚洲男人天堂av| 成人国产精品免费观看动漫| 日韩一区二区三区四区| 亚洲一区在线观看免费观看电影高清| 丁香六月综合激情| 久久亚洲春色中文字幕久久久| 日韩主播视频在线| 欧美日韩一区在线| 亚洲一区在线观看免费观看电影高清| 床上的激情91.| 久久久久久久性| 极品销魂美女一区二区三区| 欧美夫妻性生活| 午夜亚洲国产au精品一区二区| 色综合久久综合网| 亚洲图片你懂的| 91在线国产福利| 亚洲欧美国产77777| 99久久婷婷国产精品综合| 国产精品全国免费观看高清| 成人在线综合网| 亚洲欧洲精品一区二区三区|