Class 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.
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll
Syntax
[TelerikToolboxCategory("Menus & Toolbars")]
public class RadCommandBar : RadControl, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IPCHost, IAnalyticsProvider
Constructors
RadCommandBar()
Fields
OrientationChangedEventKey
The key for the OrientationChanged event.
Declaration
public static readonly object OrientationChangedEventKey
Field Value
System.Object
|
OrientationChangingEventKey
The key for the OrientationChanging event.
Declaration
public static readonly object OrientationChangingEventKey
Field Value
System.Object
|
Properties
AutoSize
Gets or sets a value indicating whether the control automatically resizes to fit its contents.
Declaration
public override bool AutoSize { get; set; }
Property Value
System.Boolean
|
Overrides
BackColor
RadCommandBar consists of multiple visual elements and separate settings are provided to customize their appearance. Current BackColor property might be ignored.
Declaration
public override Color BackColor { get; set; }
Property Value
System.Drawing.Color
|
Overrides
CommandBarElement
Gets or sets the RadCommandBarElement of the RadCommandBar control.
Declaration
public RadCommandBarElement CommandBarElement { get; set; }
Property Value
RadCommandBarElement
|
CustomizeContextMenu
Gets the menu opened upon rightclick on the control.
Declaration
public RadDropDownMenu CustomizeContextMenu { get; }
Property Value
RadDropDownMenu
|
DefaultSize
Declaration
protected override Size DefaultSize { get; }
Property Value
System.Drawing.Size
|
Dock
Gets or sets which RadCommandBar borders are docked to its parent control and determines how a control is resized with its parent.
Declaration
public override DockStyle Dock { get; set; }
Property Value
System.Windows.Forms.DockStyle
One of the System.Windows.Forms.DockStyle values. The default is System.Windows.Forms.DockStyle.None. |
Exceptions
System.ComponentModel.InvalidEnumArgumentException
The value assigned is not one of the System.Windows.Forms.DockStyle values. |
DragSize
Gets or sets the size in pixels when current strip is being Drag and Drop in next or previous row.
Declaration
public Size DragSize { get; set; }
Property Value
System.Drawing.Size
|
ForeColor
RadCommandBar consists of multiple visual elements and separate settings are provided to customize their appearance. Current ForeColor property might be ignored.
Declaration
public override Color ForeColor { get; set; }
Property Value
System.Drawing.Color
|
Overrides
Orientation
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.
Declaration
public Orientation Orientation { get; set; }
Property Value
System.Windows.Forms.Orientation
|
Rows
Gets the rows of the commandbar.
Declaration
[RadNewItem("", false, true, true)]
[RadEditItemsAction]
public RadCommandBarLinesElementCollection Rows { get; }
Property Value
RadCommandBarLinesElementCollection
|
Text
This property is not relevant for this class.
Declaration
public override string Text { get; set; }
Property Value
System.String
|
Overrides
Methods
ControlDefinesThemeForElement(RadElement)
Declaration
public override bool ControlDefinesThemeForElement(RadElement element)
Parameters
RadElement
element
|
Returns
System.Boolean
|
Overrides
CreateAccessibilityInstance()
Creates an accessibility instance for the command bar control.
Declaration
protected override AccessibleObject CreateAccessibilityInstance()
Returns
System.Windows.Forms.AccessibleObject
A RadCommandBarAccessibleObject if accessibility is enabled; otherwise, the base accessibility object. |
CreateChildItems(RadElement)
Creates and initializes the child items of the command bar, including the main command bar element and context menu.
Declaration
protected override void CreateChildItems(RadElement parent)
Parameters
RadElement
parent
The parent RadElement to which child elements will be added. |
Overrides
CreateCommandBarElement()
Creates the command bar element for the RadCommandBar.
Declaration
protected virtual RadCommandBarElement CreateCommandBarElement()
Returns
RadCommandBarElement
A new instance of RadCommandBarElement. |
CreateRootElement()
Creates the root element for the RadCommandBar.
Declaration
protected override RootRadElement CreateRootElement()
Returns
RootRadElement
A new instance of RadCommandBar.RadCommandBarRootElement. |
Overrides
GetPreferredSize(Size)
Declaration
public override Size GetPreferredSize(Size proposedSize)
Parameters
System.Drawing.Size
proposedSize
|
Returns
System.Drawing.Size
|
Overrides
OnLoad(Size)
Declaration
protected override void OnLoad(Size desiredSize)
Parameters
System.Drawing.Size
desiredSize
|
Overrides
OnMouseDown(MouseEventArgs)
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
System.Windows.Forms.MouseEventArgs
e
|
Overrides
OnOrientationChanged(EventArgs)
Raises the RadCommandBar.OrientationChanged event.
Declaration
protected virtual void OnOrientationChanged(EventArgs args)
Parameters
System.EventArgs
args
A System.EventArgs that contains the event data. |
OnOrientationChanging(CancelEventArgs)
Raises the RadCommandBar.OrientationChanging event.
Declaration
protected virtual bool OnOrientationChanging(CancelEventArgs args)
Parameters
System.ComponentModel.CancelEventArgs
args
A System.ComponentModel.CancelEventArgs that contains the event data. |
Returns
System.Boolean
True if the change of orientation should be canceled, false otherwise. |
OnParentChanged(EventArgs)
Declaration
protected override void OnParentChanged(EventArgs e)
Parameters
System.EventArgs
e
|
Overrides
OnThemeChanged()
ProcessAutoSizeChanged(Boolean)
Declaration
protected override void ProcessAutoSizeChanged(bool value)
Parameters
System.Boolean
value
|
Overrides
ProcessCodedUIMessage(ref IPCMessage)
Declaration
protected override void ProcessCodedUIMessage(ref IPCMessage request)
Parameters
IPCMessage
request
|
Overrides
ResetBackColorThemeOverrides()
Declaration
protected override void ResetBackColorThemeOverrides()
Overrides
ResetForeColorThemeOverrides()
Declaration
protected override void ResetForeColorThemeOverrides()
Overrides
SetBackColorThemeOverrides()
Declaration
protected override void SetBackColorThemeOverrides()
Overrides
SetForeColorThemeOverrides()
Declaration
protected override void SetForeColorThemeOverrides()
Overrides
SetOrientationCore(Orientation, Boolean)
Applies the orientation to the control and its child elements.
Declaration
protected virtual void SetOrientationCore(Orientation value, bool fireEvents)
Parameters
System.Windows.Forms.Orientation
value
The orientation to apply |
System.Boolean
fireEvents
Indicates whether events should be fired |
SetThemeCore()
Propagate ThemeName to child bar's menu
Declaration
protected virtual void SetThemeCore()
Events
FloatingStripCreated
Occurs when a floating strip is created.
Declaration
public event EventHandler FloatingStripCreated
Event Type
System.EventHandler
|
FloatingStripCreating
Occurs before a floating form is created.
Declaration
public event CancelEventHandler FloatingStripCreating
Event Type
System.ComponentModel.CancelEventHandler
|
FloatingStripDocked
Occurs when a floating strip is docked.
Declaration
public event EventHandler FloatingStripDocked
Event Type
System.EventHandler
|
FloatingStripDocking
Occurs before a floating strip is docked.
Declaration
public event CancelEventHandler FloatingStripDocking
Event Type
System.ComponentModel.CancelEventHandler
|
OrientationChanged
Occurs after the orientation is changed.
Declaration
public event EventHandler OrientationChanged
Event Type
System.EventHandler
|
OrientationChanging
Occurs before the orientation is changed.
Declaration
public event CancelEventHandler OrientationChanging
Event Type
System.ComponentModel.CancelEventHandler
|