BinaryMenuItemManager
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.
Members at a glance
| Properties | |
|---|---|
BlendFactorForBackgroundColor | Gets or sets how much of the window colour is mixed into MenuItemBackgroundColor while UseAlphaBlending is on. |
BlendFactorForControlColor | Gets or sets how strongly MenuItemControlColor shows over the items' background while UseAlphaBlending is on. |
BlendFactorForGroupHeaderBackColor | Not used: group header colours are set through RedrawGroupHeaders(). |
BlendFactorForSelectionColor | Gets or sets how strongly MenuItemSelectionColor shows over the window colour while UseAlphaBlending is on. |
CheckMarkAndRadioButtonColor | Gets or sets the color to be used in drawing the Checkmark and radio buttons in menuitems, wherever applicable. |
DrawMenuSideBarUsingThisStyle | Gets or sets the style of rendering to use when drawing the menu item's side-bar area. |
MenuItemBackgroundColor | Gets or sets the background colour of every BinaryMenuItem. |
MenuItemBorderColor | Gets or sets the colour of the outline round the menu item under the pointer. |
MenuItemControlColor | Gets or sets the BinaryMenuItem's control color. |
MenuItemSelectionColor | Gets or sets the colour of the highlight behind the menu item under the pointer, and of pressed check marks and radio buttons. |
MenuItemSelectionColorRenderingStyle | Gets or sets the rendering style for drawing the menu item selection rectangle area. |
MenuRenderingStyle | Gets or sets the menu side-bar rendering style. |
OrientationFactor | Gets or sets the orientation factor to use when drawing the menu item's side-bar using DrawMenuSideBarUsingThisStyle as
MenuSideBarRenderingStyle.GradientBrushStyle and the property MenuRenderingStyle is set to MenuRenderingStyle.Custom. |
UseAlphaBlending | Gets or sets whether the custom/default colors used for building menuitems, will have alpha-blending enabled or not. |
| Methods | |
PerformPaint | The handler to hook into, whenever there is a need to update any changes that may have been made to the color/alphablending properties. |
PerformPaintHandler | The handler to hook into, whenever there is a need to update any changes that may have made to the color/alphablending properties. |
RedrawGroupHeaders | 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. |
RedrawGroupHeaders | 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. |
RedrawGroupHeaders | Sets the background and border colors of every group header on a form's menus, and on every submenu beneath them. |
RedrawGroupHeaders | Sets the background, border and text colors of every group header on a form's menus, and on every submenu beneath them. |
RedrawGroupHeaders | 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. |
Properties
BlendFactorForBackgroundColor static
Gets or sets how much of the window colour is mixed into MenuItemBackgroundColor while UseAlphaBlending is on.
- Value
- From 0 (the background colour as set) to 255 (the plain window colour). The default is 220, a near-white tint.
Remarks
Applies to menus painted after the change; call PerformPaint to repaint the form's menus.
BlendFactorForControlColor static
Gets or sets how strongly MenuItemControlColor shows over the items' background while UseAlphaBlending is on.
- Value
- From 0 (the background colour) to 255 (the control colour as set). The default is 195.
BlendFactorForGroupHeaderBackColor static
Not used: group header colours are set through RedrawGroupHeaders().
- Value
- The default is 165. Kept for compatibility.
BlendFactorForSelectionColor static
Gets or sets how strongly MenuItemSelectionColor shows over the window colour while UseAlphaBlending is on.
- Value
- From 0 (the plain window colour) to 255 (the selection colour as set). The default is 70, a pale tint.
CheckMarkAndRadioButtonColor static
Gets or sets the color to be used in drawing the Checkmark and radio buttons in menuitems, wherever applicable.
Remarks
Typically, you can use this property when you have menuitems with MenuItem.Checked and/or MenuItem.RadioCheck properties set to true.
OrientationFactor static
Gets or sets the orientation factor to use when drawing the menu item's side-bar using DrawMenuSideBarUsingThisStyle as
MenuSideBarRenderingStyle.GradientBrushStyle and the property MenuRenderingStyle is set to MenuRenderingStyle.Custom.
Remarks
The default value is (float) 90.0.
UseAlphaBlending static
Gets or sets whether the custom/default colors used for building menuitems, will have alpha-blending enabled or not.
Remarks
Alpha-blending gets you a smooth color effect while painting the menuitems. By default, this property is set to true.
Methods
PerformPaint static
The handler to hook into, whenever there is a need to update any changes that may have been made to the color/alphablending properties.
Parameters
mainform- Ensure the sender object is always the
Formobject which is the parent of the BinaryMenuItem.
Remarks
This method ensures that all the menuitems will be properly redrawn with their changed color and alpha-blending properties.
PerformPaintHandler static
The handler to hook into, whenever there is a need to update any changes that may have made to the color/alphablending properties.
Parameters
RedrawGroupHeaders static
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.
Parameters
mainform- The form whose menus are to be restyled.
value- true to draw the border as dots, false for a solid line.
RedrawGroupHeaders static
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.
Parameters
mainform- The form whose menus are to be restyled.
value- The gap, in pixels.
RedrawGroupHeaders static
Sets the background and border colors of every group header on a form's menus, and on every submenu beneath them.
Parameters
mainform- The form whose menus are to be restyled.
backColor- The header background color.
borderColor- The header border color.
RedrawGroupHeaders static
Sets the background, border and text colors of every group header on a form's menus, and on every submenu beneath them.
Parameters
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 static
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.
Parameters
mainform- The form whose menus are to be redrawn.