HypernovaDesktop Components · docs
Binarymission
WinFormsMenu Item › BinaryMenuItemManager

BinaryMenuItemManager

class.NET Framework 4.8Binarymission.WinForms.Controls.MenuControls

BinaryMenuItemManager is the property manager class, which lets you set various properties to be applicable across all instances of BinaryMenuItem objects.

public sealed class BinaryMenuItemManager

Remarks

BinaryMenuItem component extends the standard .NET framework MenuItem object by enabling you to set various custom colors and alpha-blending values while drawing the menu items.
You can use this class to set its various color and alpha-blending static properties for painting your menuitems.
The default values of these properties ensure that your menuitems emulate a close look-and-feel of XP/VS.NET style menus.
You can set the class's static properties to further customise the look-and-feel of the menus, as per your choice.

Members at a glance

BlendFactorForBackgroundColorGets or sets the alpha-blending factor for blending the MenuItem background color.
BlendFactorForControlColorGets or sets the alpha-blending factor for blending the MenuItem control color.
BlendFactorForGroupHeaderBackColorGets or sets the alpha-blending factor for blending the MenuItem control color.
BlendFactorForSelectionColorGets or sets the alpha-blending factor for blending the MenuItem selection color.
CheckMarkAndRadioButtonColorGets or sets the color to be used in drawing the Checkmark and radio buttons in menuitems, wherever applicable.
DrawMenuSideBarUsingThisStyleGets or sets the style of rendering to use when drawing the menu item's side-bar area.
MenuItemBackgroundColorGets or sets the BinaryMenuItem's background color.
MenuItemBorderColorGets or sets the BinaryMenuItem's border color.
MenuItemControlColorGets or sets the BinaryMenuItem's control color.
MenuItemSelectionColorGets or sets the BinaryMenuItem's selection color.
MenuItemSelectionColorRenderingStyleGets or sets the rendering style for drawing the menu item selection rectangle area.
MenuRenderingStyleGets or sets the menu side-bar rendering style.
OrientationFactorGets or sets the orientation factor to use when drawing the menu item's side-bar using DrawMenuSideBarUsingThisStyle as GradientBrushStyle and the property MenuRenderingStyle is set to Custom.
UseAlphaBlendingGets or sets whether the custom/default colors used for building menuitems, will have alpha-blending enabled or not.
PerformPaintThe handler to hook into, whenever there is a need to update any changes that may have been made to the color/alphablending properties.
PerformPaintHandlerThe handler to hook into, whenever there is a need to update any changes that may have made to the color/alphablending properties.
RedrawGroupHeadersSets whether group header borders are drawn as dotted lines, on every menu item of a form - both its main menu and its context menu - and on every submenu beneath them.
RedrawGroupHeadersSets the gap between a group header and its border, on every menu item of a form - both its main menu and its context menu - and on every submenu beneath them.
RedrawGroupHeadersSets the background and border colors of every group header on a form's menus, and on every submenu beneath them.
RedrawGroupHeadersSets the background, border and text colors of every group header on a form's menus, and on every submenu beneath them.
RedrawGroupHeadersRedraws every group header on a form's menus using the colors each item already carries, which is how a change made item by item is pushed through in one pass.

Properties

BlendFactorForBackgroundColor

public static int BlendFactorForBackgroundColor

Gets or sets the alpha-blending factor for blending the MenuItem background color.

BlendFactorForControlColor

public static int BlendFactorForControlColor

Gets or sets the alpha-blending factor for blending the MenuItem control color.

BlendFactorForGroupHeaderBackColor

public static int BlendFactorForGroupHeaderBackColor

Gets or sets the alpha-blending factor for blending the MenuItem control color.

BlendFactorForSelectionColor

public static int BlendFactorForSelectionColor

Gets or sets the alpha-blending factor for blending the MenuItem selection color.

CheckMarkAndRadioButtonColor

public static Color CheckMarkAndRadioButtonColor

Gets or sets the color to be used in drawing the Checkmark and radio buttons in menuitems, wherever applicable.

Typically, you can use this property when you have menuitems with Checked and/or RadioCheck properties set to true.

DrawMenuSideBarUsingThisStyle

public static MenuSideBarRenderingStyle DrawMenuSideBarUsingThisStyle

Gets or sets the style of rendering to use when drawing the menu item's side-bar area.

The default value is SolidBrush.

MenuItemBackgroundColor

public static Color MenuItemBackgroundColor

Gets or sets the BinaryMenuItem's background color.

MenuItemBorderColor

public static Color MenuItemBorderColor

Gets or sets the BinaryMenuItem's border color.

MenuItemControlColor

public static Color MenuItemControlColor

Gets or sets the BinaryMenuItem's control color.

Set this property to set the color of the Image bar (sidebar) in the BinaryMenuItem.

MenuItemSelectionColor

public static Color MenuItemSelectionColor

Gets or sets the BinaryMenuItem's selection color.

MenuItemSelectionColorRenderingStyle

public static MenuItemSelectionColorRenderingStyle MenuItemSelectionColorRenderingStyle

Gets or sets the rendering style for drawing the menu item selection rectangle area.

MenuRenderingStyle

public static MenuRenderingStyle MenuRenderingStyle

Gets or sets the menu side-bar rendering style.

The default value is OutlookBlueTheme. Note: Setting this property to None will make the DrawMenuSideBarUsingThisStyle property to use the SolidBrush value.

OrientationFactor

public static float OrientationFactor

Gets or sets the orientation factor to use when drawing the menu item's side-bar using DrawMenuSideBarUsingThisStyle as GradientBrushStyle and the property MenuRenderingStyle is set to Custom.

The default value is (float) 90.0.

UseAlphaBlending

public static bool UseAlphaBlending

Gets or sets whether the custom/default colors used for building menuitems, will have alpha-blending enabled or not.

Alpha-blending gets you a smooth color effect while painting the menuitems. By default, this property is set to true.

Methods

PerformPaint

public static void PerformPaint(Form mainform)

The handler to hook into, whenever there is a need to update any changes that may have been made to the color/alphablending properties.

mainform
Ensure the sender object is always the Form object which is the parent of the BinaryMenuItem.
This method ensures that all the menuitems will be properly redrawn with their changed color and alpha-blending properties.
Whenever a change is made to any property in this class, please ensure to call this method in order to ensure the menuitems are re-drawn with the appropriate changed properties.
When making a group of changes to the properties, you can call this method once, after all the property changes are made.

PerformPaintHandler

public static void PerformPaintHandler(object sender, EventArgs e)

The handler to hook into, whenever there is a need to update any changes that may have made to the color/alphablending properties.

sender
Ensure the sender object is always the Form object which is the parent of the BinaryMenuItem.
e
Can be an empty EventArgs.

RedrawGroupHeaders

public static void RedrawGroupHeaders(Form mainform, bool value)

Sets whether group header borders are drawn as dotted lines, on every menu item of a form - both its main menu and its context menu - and on every submenu beneath them.

mainform
The form whose menus are to be restyled.
value
true to draw the border as dots, false for a solid line.

RedrawGroupHeaders

public static void RedrawGroupHeaders(Form mainform, int value)

Sets the gap between a group header and its border, on every menu item of a form - both its main menu and its context menu - and on every submenu beneath them.

mainform
The form whose menus are to be restyled.
value
The gap, in pixels.

RedrawGroupHeaders

public static void RedrawGroupHeaders(Form mainform, Color backColor, Color borderColor)

Sets the background and border colors of every group header on a form's menus, and on every submenu beneath them.

mainform
The form whose menus are to be restyled.
backColor
The header background color.
borderColor
The header border color.

RedrawGroupHeaders

public static void RedrawGroupHeaders(Form mainform, Color backColor, Color borderColor, Color foreColor)

Sets the background, border and text colors of every group header on a form's menus, and on every submenu beneath them.

mainform
The form whose menus are to be restyled.
backColor
The header background color.
borderColor
The header border color.
foreColor
The header text color.

RedrawGroupHeaders

public static void RedrawGroupHeaders(Form mainform)

Redraws every group header on a form's menus using the colors each item already carries, which is how a change made item by item is pushed through in one pass.

mainform
The form whose menus are to be redrawn.