CommandBarMenu.cs
上传用户:nnpulika
上传日期:2013-02-15
资源大小:597k
文件大小:1k
源码类别:

状态条

开发平台:

C#

  1. using System;
  2. using System.Windows.Forms;
  3. using System.Drawing;
  4. using System.ComponentModel;
  5. using UtilityLibrary.Menus;
  6. using UtilityLibrary.Collections;
  7. namespace UtilityLibrary.CommandBars
  8. {
  9. /// <summary>
  10. /// Summary description for CommandBaMenu
  11. /// </summary>
  12. [ToolboxItem(false)] 
  13. public class CommandBarMenu : ContextMenu
  14. {
  15. #region Class Variables
  16. // This is just to keep track of the selected
  17. // menu as well as hold the menuitems in the menubar
  18. Menu selectedMenuItem = null;
  19. #endregion
  20. #region Constructors
  21. public CommandBarMenu(MenuItemExCollection items)
  22. {
  23. for(int i = 0; i < items.Count; i++)
  24. {
  25. MenuItems.Add((MenuItemEx)items[i]);
  26. }
  27. }
  28. #endregion
  29. #region Overrides
  30. protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
  31. {
  32. return base.ProcessCmdKey(ref msg, keyData);
  33. }
  34. #endregion
  35. #region Properties
  36. internal Menu SelectedMenuItem
  37. {
  38. set { selectedMenuItem = value; }
  39. get { return selectedMenuItem; }
  40. }
  41. #endregion
  42. }
  43. }