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.
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
BlendFactorForBackgroundColor | Gets or sets the alpha-blending factor for blending the MenuItem background color. |
BlendFactorForControlColor | Gets or sets the alpha-blending factor for blending the MenuItem control color. |
BlendFactorForGroupHeaderBackColor | Gets or sets the alpha-blending factor for blending the MenuItem control color. |
BlendFactorForSelectionColor | Gets or sets the alpha-blending factor for blending the MenuItem selection color. |
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 BinaryMenuItem's background color. |
MenuItemBorderColor | Gets or sets the BinaryMenuItem's border color. |
MenuItemControlColor | Gets or sets the BinaryMenuItem's control color. |
MenuItemSelectionColor | Gets or sets the BinaryMenuItem's selection color. |
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 GradientBrushStyle and the property MenuRenderingStyle is set to Custom. |
UseAlphaBlending | Gets or sets whether the custom/default colors used for building menuitems, will have alpha-blending enabled or not. |
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
Gets or sets the alpha-blending factor for blending the MenuItem background color.
BlendFactorForControlColor
Gets or sets the alpha-blending factor for blending the MenuItem control color.
BlendFactorForGroupHeaderBackColor
Gets or sets the alpha-blending factor for blending the MenuItem control color.
BlendFactorForSelectionColor
Gets or sets the alpha-blending factor for blending the MenuItem selection color.
CheckMarkAndRadioButtonColor
Gets or sets the color to be used in drawing the Checkmark and radio buttons in menuitems, wherever applicable.
Checked and/or RadioCheck properties set to true.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.
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.
- mainform
- Ensure the sender object is always the
Formobject which is the parent of the BinaryMenuItem.
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
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
Formobject which is the parent of the BinaryMenuItem. - e
- Can be an empty
EventArgs.
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.
- mainform
- The form whose menus are to be restyled.
- value
- true to draw the border as dots, false for a solid line.
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.
- mainform
- The form whose menus are to be restyled.
- value
- The gap, in pixels.
RedrawGroupHeaders
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
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
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.