ClassRadMenu
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
RadMenu()
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.
Declaration
public RadMenu()
Properties
AllItemsEqualHeight
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.
Declaration
[Browsable(true)]
public bool AllItemsEqualHeight { get; set; }
Property Value
AllowMerge
Gets or sets a value indicating whether this menu allows merging with other RadMenu instances to create a unified menu structure.
AutoSize
Gets or sets a value indicating whether the menu automatically adjusts its size to fit its content.
Declaration
public override bool AutoSize { get; set; }
Property Value
Overrides
BackColor
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.
Declaration
public override Color BackColor { get; set; }
Property Value
Overrides
DefaultSize
Declaration
protected override Size DefaultSize { get; }
Property Value
Overrides
Dock
Gets or sets which edge of the parent container the menu is docked to.
Declaration
public override DockStyle Dock { get; set; }
Property Value
Overrides
DropDownAnimationEasing
Gets or sets the easing type used for dropdown animations when DropDownAnimationEnabled is true.
Declaration
[Browsable(true)]
public RadEasingType DropDownAnimationEasing { get; set; }
Property Value
DropDownAnimationEnabled
Gets or sets a value indicating whether dropdown animations are enabled when submenu items are displayed.
Declaration
[Browsable(true)]
public bool DropDownAnimationEnabled { get; set; }
Property Value
DropDownAnimationFrames
Gets or sets the number of frames used for dropdown animations when DropDownAnimationEnabled is true.
Declaration
[Browsable(true)]
public int DropDownAnimationFrames { get; set; }
Property Value
IsMainMenu
Gets or sets a value indicating whether this RadMenu handles MDI (Multiple Document Interface) menu functionality and system buttons for child forms.
Declaration
[Browsable(true)]
public bool IsMainMenu { get; set; }
Property Value
Items
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.
Declaration
[RadEditItemsAction]
[RadNewItem("Type here", true, true, false)]
[Browsable(true)]
public override RadItemOwnerCollection Items { get; }
Property Value
Overrides
MenuElement
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.
Declaration
[Browsable(false)]
public RadMenuElement MenuElement { get; }
Property Value
Orientation
Gets or sets the Orientation of menu items, determining whether they are arranged horizontally or vertically.
Declaration
[Browsable(true)]
public Orientation Orientation { get; set; }
Property Value
StretchItems
Gets or sets a value indicating whether menu items should be stretched to fill the available space in the menu.
Declaration
[Browsable(true)]
public bool StretchItems { get; set; }
Property Value
SystemKeyHighlight
Gets or sets a value indicating whether the Alt or F10 keys can be used to highlight and activate the menu for keyboard navigation.
Declaration
[Browsable(true)]
public bool SystemKeyHighlight { get; set; }
Property Value
Methods
CanProcessItem(RadMenuItemBase)
Declaration
protected virtual bool CanProcessItem(RadMenuItemBase menuItem)
Parameters
menuItem
Returns
CanProcessMnemonic(char)
Determines whether the specified character can be processed as a mnemonic for any menu item.
CreateAccessibilityInstance()
Declaration
protected override AccessibleObject CreateAccessibilityInstance()
Returns
Overrides
CreateChildItems(RadElement)
Creates and initializes the child elements of the menu, including the RadMenuElement and its event handlers.
Declaration
protected override void CreateChildItems(RadElement parent)
Parameters
parent
The parent element to add child elements to.
Overrides
CreateRootElement()
Declaration
protected override RootRadElement CreateRootElement()
Returns
Overrides
Dispose(bool)
Declaration
protected override void Dispose(bool disposing)
Parameters
disposing
Overrides
GetCurrentProcessedItem(IItemsControl)
Declaration
protected virtual RadMenuItemBase GetCurrentProcessedItem(IItemsControl itemsControl)
Parameters
itemsControl
Returns
GetSysCharItem(IItemsControl, char)
Declaration
protected virtual RadMenuItemBase GetSysCharItem(IItemsControl itemsControl, char searchKey)
Parameters
itemsControl
searchKey
Returns
InitializeRootElement(RootRadElement)
Initializes the root element with default property values for the menu.
Declaration
protected override void InitializeRootElement(RootRadElement rootElement)
Parameters
rootElement
The root element to initialize.
Overrides
MergeMenu(RadMenu)
Merges the specified RadMenu with this menu, combining their menu items according to merge settings.
Declaration
public virtual void MergeMenu(RadMenu sourceMenu)
Parameters
sourceMenu
The source RadMenu to merge into this menu.
Exceptions
Thrown when attempting to merge a menu with itself.
OnAllItemsEqualHeightChanged(EventArgs)
Raises the AllItemsEqualHeightChanged event when the equal height setting for menu items changes.
OnHandleCreated(EventArgs)
Called when the control handle is created. Sets up MDI functionality and system button handling if the parent form is an MDI container.
OnHandleDestroyed(EventArgs)
Declaration
protected override void OnHandleDestroyed(EventArgs e)
Parameters
e
Overrides
OnItemDeselected(ItemSelectedEventArgs)
Declaration
protected override void OnItemDeselected(ItemSelectedEventArgs args)
Parameters
args
Overrides
OnItemSelected(ItemSelectedEventArgs)
Declaration
protected override void OnItemSelected(ItemSelectedEventArgs args)
Parameters
args
Overrides
OnLeave(EventArgs)
Declaration
protected override void OnLeave(EventArgs e)
Parameters
e
Overrides
OnLoad(Size)
Notifies that the control is about to be visualized.
Declaration
protected override void OnLoad(Size desiredSize)
Parameters
desiredSize
Overrides
OnMenuStateChanged(RadMenuState, RadMenuState)
Called when the menu state changes, handling the transition between different RadMenu.RadMenuState values.
Declaration
protected virtual void OnMenuStateChanged(RadMenu.RadMenuState oldState, RadMenu.RadMenuState newState)
Parameters
oldState
The previous RadMenu.RadMenuState.
newState
The new RadMenu.RadMenuState.
OnMouseDown(MouseEventArgs)
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
e
Overrides
OnMouseMove(MouseEventArgs)
Declaration
protected override void OnMouseMove(MouseEventArgs e)
Parameters
e
Overrides
OnOrientationChanged(EventArgs)
Raises the OrientationChanged event when the menu orientation changes.
OnTextOrientationChanged(EventArgs)
Raises the TextOrientationChanged event when the text orientation property value changes.
PerformMouseDown(RadMenuItemBase)
Declaration
protected virtual void PerformMouseDown(RadMenuItemBase menuItem)
Parameters
menuItem
PreprocessMouseEvent(ref Message)
Declaration
protected virtual void PreprocessMouseEvent(ref Message msg)
Parameters
msg
ProcessAutoSizeChanged(bool)
Declaration
protected override void ProcessAutoSizeChanged(bool value)
Parameters
value
Overrides
ProcessCodedUIMessage(ref IPCMessage)
Declaration
protected override void ProcessCodedUIMessage(ref IPCMessage request)
Parameters
request
IPCMessage
Overrides
ProcessFocusRequested(RadElement)
Processes a focus request from the specified element.
Declaration
protected override bool ProcessFocusRequested(RadElement element)
Parameters
element
The element that requested the focus.
Returns
True if focus is approved, false otherwise.
Overrides
ResetBackColorThemeOverrides()
Declaration
protected override void ResetBackColorThemeOverrides()
Overrides
SetBackColorThemeOverrides()
Declaration
protected override void SetBackColorThemeOverrides()
Overrides
SetMenuState(RadMenuState)
Sets the current state of the menu for mnemonic and keyboard processing.
Declaration
public void SetMenuState(RadMenu.RadMenuState state)
Parameters
state
The RadMenu.RadMenuState to set for the menu.
UnmergeMenu(RadMenu)
Removes the merge relationship with the specified RadMenu, restoring the original menu structure.
Events
AllItemsEqualHeightChanged
Occurs when the AllItemsEqualHeight property value changes, indicating a change in the height uniformity setting for menu items.
Declaration
public event EventHandler AllItemsEqualHeightChanged
Event Value
OrientationChanged
Occurs when the Orientation property value changes, indicating a change in the layout direction of menu items.
TextOrientationChanged
Occurs when the text orientation property value changes, affecting how text is displayed within menu items.
Declaration
public event EventHandler TextOrientationChanged
Event Value