HypernovaDesktop Components · docs
Binarymission
WinForms › Binary Menu Controls › IMenuStripColorTable

IMenuStripColorTable

interface.NET 6 / 8 / 10Binarymission.WinForms.Controls.ExtendedMenuControls.Abstractions

The colours and arrow shape an ExtendedContextMenuStrip uses for text, submenu arrows and check marks, beyond those a ProfessionalColorTable supplies.

public interface IMenuStripColorTable

Remarks

Implement it on a class that derives from ProfessionalColorTable - the menu needs both: the base class for backgrounds, borders, the image margin and the highlight behind the item under the pointer, and this interface for what is drawn on top of them. Pass an instance to the ExtendedContextMenuStrip() constructor, or to a control that takes one, such as the smart button's MenuStripColorTable.

"Selected" means the item under the pointer or chosen with the arrow keys.

Examples

public sealed class HighContrastMenuColours : ProfessionalColorTable, IMenuStripColorTable
{
    public override Color ToolStripDropDownBackground => Color.Black;
    public override Color ImageMarginGradientBegin => Color.Black;
    public override Color ImageMarginGradientMiddle => Color.Black;
    public override Color ImageMarginGradientEnd => Color.Black;
    public override Color MenuItemSelected => Color.Yellow;

    public Color ArrowColor => Color.Yellow;
    public Color ArrowColorWhenItemSelected => Color.Black;
    public Color MenuItemTextColor => Color.White;
    public Color MenuItemTextColorWhenItemSelected => Color.Black;
    public ArrowKind ArrowRenderingStyle => ArrowKind.Thick;
}

Members at a glance

Properties
ArrowColorGets the colour of submenu arrows and check marks on items that are not selected.
ArrowColorWhenItemSelectedGets the colour of the submenu arrow and check mark on the selected item.
ArrowRenderingStyleGets the shape of the arrow drawn beside an item that opens a submenu.
MenuItemTextColorGets the colour of an item's text while it is not selected.
MenuItemTextColorWhenItemSelectedGets the colour of the selected item's text.

Properties

ArrowColor

Color ArrowColor

Gets the colour of submenu arrows and check marks on items that are not selected.

See also

ArrowColorWhenItemSelected

Color ArrowColorWhenItemSelected

Gets the colour of the submenu arrow and check mark on the selected item.

Remarks

Choose a colour that stands out against the selection highlight from MenuItemSelected.

ArrowRenderingStyle

ArrowKind ArrowRenderingStyle

Gets the shape of the arrow drawn beside an item that opens a submenu.

Value
ArrowKind.Thick for the standard filled arrow, or ArrowKind.Skinny for a thin line chevron.

MenuItemTextColor

Color MenuItemTextColor

Gets the colour of an item's text while it is not selected.

See also

MenuItemTextColorWhenItemSelected

Color MenuItemTextColorWhenItemSelected

Gets the colour of the selected item's text.

Remarks

Choose a colour that stands out against the selection highlight from MenuItemSelected.