/// <summary> /// Get the current highlighter color. /// </summary> /// <param name="imgMenuItem">The image menu item.</param> private Color GetCurrentColorHighlighter(ImageMenuItem imgMenuItem) { //Get the menu item's index int index = imgMenuItem.Index; Color color = menuItemHighlighterColors[index].Color; //Check mark the relative item foreach(ImageMenuItem i in menuItemHighlighterColors) i.Checked = (index == i.Index); return color; }
/// <summary> /// Get the current pen color. /// </summary> /// <param name="imgMenuItem">The image menu item.</param> private string GetCurrentColorPen(ImageMenuItem imgMenuItem) { //Get the menu item's index int index = imgMenuItem.Index; // Obtain the menu text without the shortcut ampersand: '&'. string colorName = StripAmpersandFromMenuText(menuItemPenColors[index].Text); //Check mark the relative item foreach(ImageMenuItem i in menuItemPenColors) i.Checked = (index == i.Index); return colorName; }
/// <summary> /// Get the current pen color. /// </summary> /// <param name="imgMenuItem">The image menu item.</param> private Color GetCurrentColorPen(ImageMenuItem imgMenuItem) { //Get the menu item's index int index = imgMenuItem.Index; // Obtain the menu text without the shortcut ampersand: '&'. Color color = menuItemPenColors[index].Color; //Check mark the relative item foreach(ImageMenuItem i in menuItemPenColors) i.Checked = (index == i.Index); return color; }