RadMenu
Represents a menu. RadMenu can be horizontal or vertical. You can add, remove, and disable menu items at run-time. It offers full theming support, allowing you to easily construct a variety of stunning visual effects. You can nest any other RadControl within a RadMenu. For example, you can create a menu with an embedded textbox or combobox.
RadMenu is a simple wrapper for the RadMenuElement class.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
[TelerikToolboxCategory("Menus & Toolbars")]
[DefaultBindingProperty("Items")]
public class RadMenu : RadItemsControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IAnalyticsProvider, IItemsControl, IMessageListener
Inheritance: objectMarshalByRefObjectComponentControlScrollableControlRadControlRadItemsControlRadMenu...
Implements:
Inherited Members
Constructors
Initializes a new instance of the RadMenu class. RadMenu can be horizontal or vertical. You can add, remove, and disable menu items at run-time. It offers full theming support, allowing you to easily construct a variety of stunning visual effects. You can nest any other RadControl within a RadMenu. For example, you can create a menu with an embedded textbox or combobox.
public RadMenu()
Properties
Gets or sets a value indicating whether all menu items will appear with the same height, using the height of the tallest item in the collection.
[Browsable(true)]
public bool AllItemsEqualHeight { get; set; }
Gets or sets a value indicating whether this menu allows merging with other RadMenu instances to create a unified menu structure.
public bool AllowMerge { get; set; }
Gets or sets a value indicating whether the menu automatically adjusts its size to fit its content.
public override bool AutoSize { get; set; }
Overrides:
Gets or sets the background color of the menu. Note that RadMenu consists of multiple visual elements and separate settings are provided to customize their appearance, so this property might be ignored.
public override Color BackColor { get; set; }
Overrides:
protected override Size DefaultSize { get; }
Overrides:
Gets or sets which edge of the parent container the menu is docked to.
public override DockStyle Dock { get; set; }
Overrides:
Gets or sets the easing type used for dropdown animations when DropDownAnimationEnabled is true.
[Browsable(true)]
public RadEasingType DropDownAnimationEasing { get; set; }
Gets or sets a value indicating whether dropdown animations are enabled when submenu items are displayed.
[Browsable(true)]
public bool DropDownAnimationEnabled { get; set; }
Gets or sets the number of frames used for dropdown animations when DropDownAnimationEnabled is true.
[Browsable(true)]
public int DropDownAnimationFrames { get; set; }
Gets or sets a value indicating whether this RadMenu handles MDI (Multiple Document Interface) menu functionality and system buttons for child forms.
[Browsable(true)]
public bool IsMainMenu { get; set; }
Gets the collection of root menu items that are displayed in the menu. Root items are top-level menu items that have no parent item and can contain child items as submenus.
[RadEditItemsAction]
[RadNewItem("Type here", true, true, false)]
[Browsable(true)]
public override RadItemOwnerCollection Items { get; }
Overrides:
Gets the instance of RadMenuElement wrapped by this control. RadMenuElement is the main element in the hierarchy tree and encapsulates the actual functionality of RadMenu.
[Browsable(false)]
public RadMenuElement MenuElement { get; }
Gets or sets the Orientation of menu items, determining whether they are arranged horizontally or vertically.
[Browsable(true)]
public Orientation Orientation { get; set; }
Gets or sets a value indicating whether keystrokes that do not match any registered mnemonic are propagated
to other controls while the menu's keyboard cues are visible (i.e. after the Alt key is pressed).
When false, such keystrokes are consumed by the menu and not dispatched to other controls such as a
focused text box. The default is true, preserving existing behavior.
[Browsable(true)]
public bool PropagateNonMnemonicKeys { get; set; }
Gets or sets a value indicating whether menu items should be stretched to fill the available space in the menu.
[Browsable(true)]
public bool StretchItems { get; set; }
Gets or sets a value indicating whether the Alt or F10 keys can be used to highlight and activate the menu for keyboard navigation.
[Browsable(true)]
public bool SystemKeyHighlight { get; set; }
Methods
protected virtual bool CanProcessItem(RadMenuItemBase menuItem)
Determines whether the specified character can be processed as a mnemonic for any menu item.
protected override AccessibleObject CreateAccessibilityInstance()
Overrides:
Creates and initializes the child elements of the menu, including the RadMenuElement and its event handlers.
protected override void CreateChildItems(RadElement parent)
The parent element to add child elements to.
Overrides:
protected virtual RadMenuItemBase GetCurrentProcessedItem(IItemsControl itemsControl)
protected virtual RadMenuItemBase GetSysCharItem(IItemsControl itemsControl, char searchKey)
Initializes the root element with default property values for the menu.
protected override void InitializeRootElement(RootRadElement rootElement)
The root element to initialize.
Overrides:
Raises the AllItemsEqualHeightChanged event when the equal height setting for menu items changes.
protected override void OnItemDeselected(ItemSelectedEventArgs args)
Overrides:
protected override void OnItemSelected(ItemSelectedEventArgs args)
Overrides:
Notifies that the control is about to be visualized.
Called when the menu state changes, handling the transition between different RadMenu.RadMenuState values.
protected virtual void OnMenuStateChanged(RadMenu.RadMenuState oldState, RadMenu.RadMenuState newState)
The previous RadMenu.RadMenuState.
newStateRadMenu.RadMenuStateThe new RadMenu.RadMenuState.
Raises the OrientationChanged event when the menu orientation changes.
Raises the TextOrientationChanged event when the text orientation property value changes.
protected virtual void PerformMouseDown(RadMenuItemBase menuItem)
protected override void ProcessCodedUIMessage(ref IPCMessage request)
Overrides:
Processes a focus request from the specified element.
protected override bool ProcessFocusRequested(RadElement element)
The element that requested the focus.
Returns:True if focus is approved, false otherwise.
Overrides:
protected override void ResetBackColorThemeOverrides()
Overrides:
protected override void SetBackColorThemeOverrides()
Overrides:
Sets the current state of the menu for mnemonic and keyboard processing.
public void SetMenuState(RadMenu.RadMenuState state)
The RadMenu.RadMenuState to set for the menu.
Events
Occurs when the AllItemsEqualHeight property value changes, indicating a change in the height uniformity setting for menu items.
public event EventHandler AllItemsEqualHeightChanged
Occurs when the Orientation property value changes, indicating a change in the layout direction of menu items.
public event EventHandler OrientationChanged
Occurs when the text orientation property value changes, affecting how text is displayed within menu items.
public event EventHandler TextOrientationChanged