ClassRadMenuElement
Represents a menu. It may be nested in other telerik controls. RadMenu can be horizontal or vertical. You can add, remove, and disable menu items at run-time. It offers full support for the Telerik RadControls for WinForm theming engine, 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.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class RadMenuElement : RadItem, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemRadMenuElement
Implements:
Inherited Members
Constructors
RadMenuElement()
Declaration
public RadMenuElement()
Fields
AllItemsEqualHeightProperty
Identifies the AllItemsEqualHeight dependency property that controls whether all menu items have the same height.
Declaration
public static RadProperty AllItemsEqualHeightProperty
Field Value
DropDownAnimationEasingProperty
Identifies the DropDownAnimationEasing dependency property that controls the easing type for dropdown animations.
Declaration
public static RadProperty DropDownAnimationEasingProperty
Field Value
DropDownAnimationEnabledProperty
Identifies the DropDownAnimationEnabled dependency property that controls whether dropdown animations are enabled.
Declaration
public static RadProperty DropDownAnimationEnabledProperty
Field Value
DropDownAnimationFramesProperty
Identifies the DropDownAnimationFrames dependency property that controls the number of animation frames.
Declaration
public static RadProperty DropDownAnimationFramesProperty
Field Value
OrientationProperty
Identifies the Orientation dependency property that determines the layout direction of menu items.
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 RadMenuElement instances to create a unified menu structure.
CloseButton
Gets or sets the close button element that provides functionality to close the parent form when the menu is used as a title bar.
Declaration
public RadImageButtonElement CloseButton { get; set; }
Property Value
ContextItem
Gets or sets the context menu item that represents the currently active context for contextual menu operations.
Declaration
public RadMenuItemBase ContextItem { get; set; }
Property Value
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
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
[Browsable(true)]
[RadNewItem("Type here", true)]
public RadItemOwnerCollection Items { get; }
Property Value
Remarks
Menu items are hierarchical - they have a parent item and a list of children items. Children items are menu items that can be dropped down as submenu of their parent. The difference between the root and the non-root menu items is that root items have no parent item (the property IsRootItem can be used to check if an item is a root one). Note that Items contains all root menu items, not just the items that are displayed. An item remains in the Items collection even if it is an overflow item and is therefore not currently visible.
ItemsLayout
Gets an instance of the WrapLayoutPanel class that represents the layout panel responsible for arranging menu items within the menu.
Declaration
[Browsable(false)]
public WrapLayoutPanel ItemsLayout { get; }
Property Value
MaximizeButton
Gets or sets the maximize button element that provides functionality to maximize or restore the parent form when the menu is used as a title bar.
Declaration
public RadImageButtonElement MaximizeButton { get; set; }
Property Value
MenuBorder
Gets an instance of the BorderPrimitive class that represents the border element of the menu.
Declaration
[Browsable(false)]
public BorderPrimitive MenuBorder { get; }
Property Value
MenuFill
Gets an instance of the FillPrimitive class that represents the background fill element of the menu.
Declaration
[Browsable(false)]
public FillPrimitive MenuFill { get; }
Property Value
MinimizeButton
Gets or sets the minimize button element that provides functionality to minimize the parent form when the menu is used as a title bar.
Declaration
public RadImageButtonElement MinimizeButton { get; set; }
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
SystemButtons
Gets or sets the StackLayoutPanel that contains the system buttons (minimize, maximize, and close) used when the menu functions as a title bar.
Declaration
public StackLayoutPanel SystemButtons { get; set; }
Property Value
Methods
ArrangeOverride(SizeF)
Arranges the child elements within the specified bounds, including proper positioning of system buttons.
CreateChildElements()
Creates and initializes the child elements of the menu, including the layout panel, system buttons, fill, and border primitives.
Declaration
protected override void CreateChildElements()
Overrides
InitializeFields()
Initializes the fields and collections used by the menu element, setting up the items collection and its properties.
Declaration
protected override void InitializeFields()
Overrides
MeasureOverride(SizeF)
Measures the size required by the menu element, including padding considerations.
OnAllItemsEqualHeightChanged(EventArgs)
Raises the AllItemsEqualHeightChanged event when the equal height setting for menu items changes.
OnOrientationChanged(EventArgs)
Raises the OrientationChanged event when the menu orientation changes.
OnPropertyChanged(RadPropertyChangedEventArgs)
Called when a property value changes. Handles orientation and equal height property changes to update the menu layout accordingly.
Declaration
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Parameters
e
A RadPropertyChangedEventArgs that contains the event data.
Overrides
OnTunnelEvent(RadElement, RoutedEventArgs)
Handles tunnel events from child elements, particularly auto-size change events for proper layout management.
Declaration
protected override void OnTunnelEvent(RadElement sender, RoutedEventArgs args)
Parameters
sender
The element that sent the event.
args
A RoutedEventArgs that contains the event data.
Overrides
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.