ContextMenuProperties
The colours and styles a SmartButton menu button uses for its drop-down menu of
BinaryMenuItem objects, edited as one expandable group in the Properties window.
public class ContextMenuProperties
Remarks
A button's settings are used while its
SmartButton.UseCustomDefinedPropertiesForRenderingContextMenu is true;
otherwise the menu takes colours that match the button's SmartButton.XPTheme.
The menu items take their colours from the process-wide BinaryMenuItemManager, and the
button writes these settings there each time its menu is prepared – so they also affect other
BinaryMenuItem menus in the application.
Examples
exportButton.ButtonStyle = ButtonStyles.MenuButton;
exportButton.UseCustomDefinedPropertiesForRenderingContextMenu = true;
exportButton.ContextMenuProperties.UseGradientPainting = true;
exportButton.ContextMenuProperties.MenuSideBarRenderingColor = Color.SteelBlue;
exportButton.ContextMenuProperties.MenuItemSelectionColor = Color.LightSkyBlue;
exportButton.ContextMenuProperties.MenuItemBorderColor = Color.SteelBlue;Members at a glance
| Properties | |
|---|---|
MenuItemBackgroundColor | Gets or sets the background colour of the menu's items. |
MenuItemBorderColor | Gets or sets the colour of the border drawn round the highlighted item. |
MenuItemRenderingStyle | Gets or sets how the item under the pointer is highlighted. |
MenuItemSelectionColor | Gets or sets the highlight colour of the item under the pointer. |
MenuSideBarRenderingColor | Gets or sets the colour of the menu's side bar – the column behind the item images and check marks. |
SmoothenSelectionColorRendering | Gets or sets whether the menu's background and highlight colours are softened by blending them with the window colour. |
UseGradientPainting | Gets or sets whether the menu's side bar – the column behind the item images – is a gradient or a solid colour. |
| Methods | |
ToString | Returns the caption the Properties window shows for the collapsed group. |
Properties
SmoothenSelectionColorRendering
Gets or sets whether the menu's background and highlight colours are softened by blending them with the window colour.
- Value
trueto use the blended colours of the shared menu settings;falseto useMenuItemBackgroundColorandMenuItemSelectionColorexactly as set. The default istrue.
Remarks
Applies only while the button's SmartButton.UseCustomDefinedPropertiesForRenderingContextMenu is true.
UseGradientPainting
Gets or sets whether the menu's side bar – the column behind the item images – is a gradient or a solid colour.
- Value
truefor a gradient from white toMenuSideBarRenderingColor;falsefor solidMenuSideBarRenderingColor. The default istrue.
Remarks
Applies only while the button's SmartButton.UseCustomDefinedPropertiesForRenderingContextMenu is true.
Methods
ToString
Returns the caption the Properties window shows for the collapsed group.
Returns
The text "Context menu settings...".