RadCommandBar
Represents a RadCommandBar control - a flexible component for implementation of tool and button bars featuring docking behavior, toggling buttons, shrinkable toolbars. The RadCommandBar is responsible for managing RadCommandBarBaseItem which are positioned on some of the CommandBarStripElement ///
Only items that inherit the RadCommandBarBaseItem class can be placed inside the strip elements. You can use the special CommandBarHostItem to host any other RadElement.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
[TelerikToolboxCategory("Menus & Toolbars")]
[Docking(DockingBehavior.Ask)]
public class RadCommandBar : RadControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IAnalyticsProvider
Inheritance: objectMarshalByRefObjectComponentControlScrollableControlRadControlRadCommandBar...
Derived Classes:
Implements:
Inherited Members
Constructors
Initializes a new instance of the RadCommandBar class.
public RadCommandBar()
Fields
The key for the OrientationChanged event.
public static readonly object OrientationChangedEventKey
The key for the OrientationChanging event.
public static readonly object OrientationChangingEventKey
Properties
Gets or sets a value indicating whether the control automatically resizes to fit its contents.
public override bool AutoSize { get; set; }
true if the control automatically resizes to fit its contents; otherwise, false.
Overrides:
RadCommandBar consists of multiple visual elements and separate settings are provided to customize their appearance. Current BackColor property might be ignored.
public override Color BackColor { get; set; }
Overrides:
Gets or sets the RadCommandBarElement of the RadCommandBar control.
[Browsable(false)]
public RadCommandBarElement CommandBarElement { get; set; }
Gets the RadDropDownMenu opened by right-clicking an empty row area or the control itself.
public RadDropDownMenu CustomizeContextMenu { get; }
Gets the default 25-by-25 control size used before an explicit size is specified.
protected override Size DefaultSize { get; }
Overrides:
Gets or sets which RadCommandBar borders are docked to its parent control and determines how a control is resized with its parent.
public override DockStyle Dock { get; set; }
The value assigned is not one of the DockStyle values.
Overrides:
Gets or sets the size in pixels when current strip is being Drag and Drop in next or previous row.
public Size DragSize { get; set; }
Gets or sets the orientation of the commandbar - could be horizontal or vertical. This property is controlled by the Dock property of the RadCommandBar control.
[Browsable(false)]
public Orientation Orientation { get; set; }
Gets the rows of the commandbar.
[RadNewItem("", false, true, true)]
[RadEditItemsAction]
[Browsable(true)]
public RadCommandBarLinesElementCollection Rows { get; }
Methods
Indicates whether the command bar supplies theme settings for the specified element types.
public override bool ControlDefinesThemeForElement(RadElement element)
The element whose theme ownership is being checked.
Returns:true for the text, drop-down, and arrow elements managed by the command bar; otherwise, false.
Overrides:
Creates an accessibility instance for the command bar control.
protected override AccessibleObject CreateAccessibilityInstance()
A RadCommandBarAccessibleObject if accessibility is enabled; otherwise, the base accessibility object.
Overrides:
Creates and initializes the child items of the command bar, including the main command bar element and context menu.
protected override void CreateChildItems(RadElement parent)
The parent RadElement to which child elements will be added.
Overrides:
Creates the command bar element for the RadCommandBar.
protected virtual RadCommandBarElement CreateCommandBarElement()
A new instance of RadCommandBarElement.
Creates the root element for the RadCommandBar.
protected override RootRadElement CreateRootElement()
A new instance of RadCommandBar.RadCommandBarRootElement.
Overrides:
Calculates the preferred size, using the current size when an auto-sized parent supplies a zero dimension.
Enables panning gestures after the control is loaded.
protected override void OnLoad(Size desiredSize)
The size requested for the control during loading.
Overrides:
Opens the strip visibility and customization context menu on a right-click over the control or a row.
protected override void OnMouseDown(MouseEventArgs e)
The mouse position and button state.
Overrides:
Raises the event.
protected virtual bool OnOrientationChanging(CancelEventArgs args)
A CancelEventArgs that contains the event data.
Returns:True if the change of orientation should be canceled, false otherwise.
Tracks the containing form so floating strips can be hidden when the form is minimized.
protected override void OnParentChanged(EventArgs e)
The event data.
Overrides:
Refreshes the theme name applied to strip overflow-button hosts.
protected override void OnThemeChanged()
Overrides:
Returns the row count for the coded-UI Lines property request and delegates other requests to the base control.
protected override void ProcessCodedUIMessage(ref IPCMessage request)
The coded-UI message to process.
Overrides:
Removes the back-color overrides from the command bar and its rows, and resets the gradient override on the command bar element.
protected override void ResetBackColorThemeOverrides()
Overrides:
Removes the foreground-color override and reapplies the theme to the element tree.
protected override void ResetForeColorThemeOverrides()
Overrides:
Applies the control's back color to the command bar and its rows, and a solid-gradient override to the command bar element.
protected override void SetBackColorThemeOverrides()
Overrides:
Applies the control's foreground color as a theme override on the command bar element.
protected override void SetForeColorThemeOverrides()
Overrides:
Applies the orientation to the control and its child elements.
protected virtual void SetOrientationCore(Orientation value, bool fireEvents)
The orientation to apply
fireEventsboolIndicates whether events should be fired
Propagates the control's theme name to each strip's overflow-button host.
protected virtual void SetThemeCore()
Events
Occurs when a floating strip is created.
public event EventHandler FloatingStripCreated
Occurs before a floating form is created.
public event CancelEventHandler FloatingStripCreating
Occurs when a floating strip is docked.
public event EventHandler FloatingStripDocked
Occurs before a floating strip is docked.
public event CancelEventHandler FloatingStripDocking
Occurs after the orientation is changed.
public event EventHandler OrientationChanged
Occurs before the orientation is changed.
public event CancelEventHandler OrientationChanging