BinaryMenuItem
BinaryMenuItem provides a feature-packed and extended "Owner-drawn" MenuItem component for building MainMenus and ContextMenus for the Microsoft WinForms© .NET platform.
public class BinaryMenuItem : MenuItem
Inherits from / implements: MenuItem
Remarks
BinaryMenuItem class replaces the standard .NET MenuItem class by providing a pre-OwnerDrawn MenuItem object with built-in rich features for building Menus in your .NET Windows Forms applications.
To build menus for your application with BinaryMenuItem .NET, you just continue to use the standard .NET Menu and ContextMenu controls, and just replace in your code, the use of standard .NET MenuItem object with BinaryMenuItem object, along with the appropriate additional object constructor values.
In addition to the standard .NET framework’s MenuItem functionality, BinaryMenuItem .NET component comes pre-Ownerdrawn and ready-to-use and offers the following rich features:
1. Simplified User-interface rendering: The component comes fully "pre-ownerdrawn", and hence all you need to do is just to set its easy-to-use properties in order to customise your menu rendering!
You do not need to owner-draw the MenuItem object any more! Just set simple properties and run your application.
2. Image support: The component comes with direct support for associating icons with menu items, including a separate image-holder side bar (emulating the VS.NET style)
3. Ability to fully support Menu painting with custom colors (with Alpha-blending support): By setting the simple properties, you can set custom colors for menu background, item selection and hovering, and painting the checkmark and radio buttons (unlike the standard .NET Framework MenuItem object which only lets you display the Radiobutton/CheckMarks in Black color)
4. Direct support for dynamic property changes: The component also comes with built-in support for handling dynamic property changes (for example, your changes to MenuItem colors at runtime) with ease - this feature lets you change the menuitem colors and its alpha-blend factors at run-time.
Note: BinaryMenuItem cannot be loaded into VS.NET toolbox (just like the MenuItem object)!
To reference it, you need to add the object into your Solution Explorer->References!
If you are not using VS.NET, please just copy the Binarymission.BinaryMenuItem.dll into your application's Bin folder (both Debug and Release folders) and in your code, add the following using statement:-
using Binarymission.WinFormControls.MenuControl;
Now you can start using BinaryMenuItem object!
Members at a glance
BinaryMenuItem | Initializes a new instance of BinaryMenuItem. |
BinaryMenuItem | Initializes a new instance of BinaryMenuItem. |
BinaryMenuItem | Initializes a new instance of BinaryMenuItem. |
BinaryMenuItem | Initializes a new instance of BinaryMenuItem. |
BinaryMenuItem | Initializes a new instance of BinaryMenuItem. |
GroupHeaderBackColor | Gets or sets the background color for the menuitem, if this is to be drawn as a group header item, rather than the standard menu item. |
GroupHeaderBorderColor | Gets or sets the color for the group header's border, if the menu item is to be drawn as a group header item, rather than the standard menu item. |
GroupHeaderDottedBorderDepth | Gets or sets the width of each border dot (when drawing the group header as dotted border). |
GroupHeaderDottedBorderGap | Gets or sets the gap between dots (when drawing the group header as dotted border). |
GroupHeaderForeColor | Gets or sets the foreground color for the menuitem, if this is to be drawn as a group header item, rather than the standard menu item. |
GroupHeaderGapWithTheBorder | Gets or sets the gap you want to have between the border and the group header drawing area. |
ImageIndex | Gets or sets the Image index of the Image to be used from the BinaryMenuItem instance's associated ImageList. |
ImageList | Gets or sets the ImageList to be associated with an instance of BinaryMenuItem. |
IsGroupHeaderBorderDrawnAsDots | Gets or sets as to whether to draw the group header as dots. |
IsMenuItemAGroupHeader | Gets or sets as to whether the given menu item instance is a group header item. |
MenuItemClickHandler | Gets or sets the EventHandler to be associated with an instance of BinaryMenuItem. |
MenuItemImage | Gets or sets the image to be associated with an instance of BinaryMenuItem. |
ShortcutText | Gets or sets the ShortcutText to be associated with an instance of BinaryMenuItem. |
Text | Gets or sets the Text for the Menu item. Refer to the base class documentation for more information. |
TransparentColorForImage | Gets or sets the transparent color for the image associated with an instance of BinaryMenuItem. |
OnDrawItem | Please refer to the base class implementation. |
OnMeasureItem | Please refer to the base class implementation. |
OnSelect | Please refer to the base class implementation. |
PrepareCustomColorMatrix | A helper method to render this BinaryMenuItem using user supplied colors. |
Constructors
Properties
GroupHeaderBackColor
Gets or sets the background color for the menuitem, if this is to be drawn as a group header item, rather than the standard menu item.
GroupHeaderBorderColor
Gets or sets the color for the group header's border, if the menu item is to be drawn as a group header item, rather than the standard menu item.
GroupHeaderDottedBorderDepth
Gets or sets the width of each border dot (when drawing the group header as dotted border).
GroupHeaderDottedBorderGap
Gets or sets the gap between dots (when drawing the group header as dotted border).
GroupHeaderForeColor
Gets or sets the foreground color for the menuitem, if this is to be drawn as a group header item, rather than the standard menu item.
GroupHeaderGapWithTheBorder
Gets or sets the gap you want to have between the border and the group header drawing area.
ImageIndex
Gets or sets the Image index of the Image to be used from the BinaryMenuItem instance's associated ImageList.
ImageList
Gets or sets the ImageList to be associated with an instance of BinaryMenuItem.
IsGroupHeaderBorderDrawnAsDots
Gets or sets as to whether to draw the group header as dots.
ShortcutText
Gets or sets the ShortcutText to be associated with an instance of BinaryMenuItem.
Text
Gets or sets the Text for the Menu item. Refer to the base class documentation for more information.
TransparentColorForImage
Gets or sets the transparent color for the image associated with an instance of BinaryMenuItem.
Methods
OnDrawItem
Please refer to the base class implementation.
OnMeasureItem
Please refer to the base class implementation.
OnSelect
Please refer to the base class implementation.
- e
PrepareCustomColorMatrix
A helper method to render this BinaryMenuItem using user supplied colors.
- menuItemBackgroundColor
- Specify a specific background color to use.
- menuItemSelectionColor
- Specifiy a specific selection color.
- menuItemControlColor
- Specify a specific color to draw the side bar in the menu item.