RadMenuElement
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
public RadMenuElement()
Fields
Identifies the AllItemsEqualHeight dependency property that controls whether all menu items have the same height.
public static RadProperty AllItemsEqualHeightProperty
Identifies the DropDownAnimationEasing dependency property that controls the easing type for dropdown animations.
public static RadProperty DropDownAnimationEasingProperty
Identifies the DropDownAnimationEnabled dependency property that controls whether dropdown animations are enabled.
public static RadProperty DropDownAnimationEnabledProperty
Identifies the DropDownAnimationFrames dependency property that controls the number of animation frames.
public static RadProperty DropDownAnimationFramesProperty
Identifies the Orientation dependency property that determines the layout direction of menu items.
public static RadProperty OrientationProperty
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 RadMenuElement instances to create a unified menu structure.
public bool AllowMerge { get; set; }
Gets or sets the close button element that provides functionality to close the parent form when the menu is used as a title bar.
public RadImageButtonElement CloseButton { get; set; }
Gets or sets the context menu item that represents the currently active context for contextual menu operations.
public RadMenuItemBase ContextItem { get; set; }
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 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.
[Browsable(true)]
[RadNewItem("Type here", true)]
public RadItemOwnerCollection Items { get; }
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.
Gets an instance of the WrapLayoutPanel class that represents the layout panel responsible for arranging menu items within the menu.
[Browsable(false)]
public WrapLayoutPanel ItemsLayout { get; }
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.
public RadImageButtonElement MaximizeButton { get; set; }
Gets an instance of the BorderPrimitive class that represents the border element of the menu.
[Browsable(false)]
public BorderPrimitive MenuBorder { get; }
Gets an instance of the FillPrimitive class that represents the background fill element of the menu.
[Browsable(false)]
public FillPrimitive MenuFill { get; }
Gets or sets the minimize button element that provides functionality to minimize the parent form when the menu is used as a title bar.
public RadImageButtonElement MinimizeButton { get; set; }
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 the StackLayoutPanel that contains the system buttons (minimize, maximize, and close) used when the menu functions as a title bar.
public StackLayoutPanel SystemButtons { get; set; }
Methods
Arranges the child elements within the specified bounds, including proper positioning of system buttons.
Creates and initializes the child elements of the menu, including the layout panel, system buttons, fill, and border primitives.
protected override void CreateChildElements()
Overrides:
Initializes the fields and collections used by the menu element, setting up the items collection and its properties.
protected override void InitializeFields()
Overrides:
Measures the size required by the menu element, including padding considerations.
Raises the AllItemsEqualHeightChanged event when the equal height setting for menu items changes.
Raises the OrientationChanged event when the menu orientation changes.
Called when a property value changes. Handles orientation and equal height property changes to update the menu layout accordingly.
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
A RadPropertyChangedEventArgs that contains the event data.
Overrides:
Handles tunnel events from child elements, particularly auto-size change events for proper layout management.
protected override void OnTunnelEvent(RadElement sender, RoutedEventArgs args)
The element that sent the event.
argsRoutedEventArgsA RoutedEventArgs that contains the event data.
Overrides:
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