Show / Hide Table of Contents

Class CommandBarControl

Base class for all items appearing in tool bars, menus and context menus.

Inheritance
object
CommandBarControl
CommandBarButton
CommandBarButtonGroup
CommandBarComboBox
CommandBarCustomControl
CommandBarHeader
CommandBarPopup
CommandBarSeparator
Namespace: ABB.Robotics.RobotStudio.Environment
Assembly: ABB.Robotics.RobotStudio.Environment.dll
Syntax
public abstract class CommandBarControl
Remarks

Most classes inheriting from CommandBarControl takes an ID argument in their constructors. Each instance of a CommandBarControl which is added to the UIEnvironment must have a unique ID. The Id is used to identify the control in for example the ExecuteCommand event handler. CommandBarControls with a unique ID and has been added to a control collection, can be found using CommandBarControls. In order to avoid collisions between Id strings used by Add-Ins, its is recomended that the name of the Add-In is used as a prefix. For example "MyCompany.MyAddin.LaunchSetupDialog", instead of using only "LaunchSetupDialog" as the Id.

The same CommandBarControl can be added to multiple collections, in order to display the same menu/toolbar choice in multiple places.

Constructors

View Source

CommandBarControl(string, string)

Internal use only

Declaration
protected CommandBarControl(string id, string caption)
Parameters
Type Name Description
string id
string caption

Properties

View Source

Caption

Gets or sets the user-visible caption of the control

Declaration
public string Caption { get; set; }
Property Value
Type Description
string
View Source

HelpId

Gets or sets the help ID of the control, used for context sensitive help.

Declaration
public string HelpId { get; set; }
Property Value
Type Description
string
Remarks

By default, this will be the same as the control ID

View Source

HelpText

Gets or sets the help text that will be displayed in ScreenTips, as well as in CommandBarGalleryPopups with the GalleryTextPosition property set to 'Right'

Declaration
public string HelpText { get; set; }
Property Value
Type Description
string
View Source

Id

Gets the unique Id of the control.

Declaration
public string Id { get; }
Property Value
Type Description
string
See Also
CommandBarControl
View Source

Image

Gets or sets the control's small (16x16 pixel for 100% display scaling) image

Declaration
public Image Image { get; set; }
Property Value
Type Description
Image
View Source

ImagePlacement

Specifies the placement of the control's image if both text and image are visible.

Declaration
public ImagePlacement ImagePlacement { get; set; }
Property Value
Type Description
ImagePlacement
Remarks

Only valid for controls in a ToolBarControl.

View Source

IsUndoable

Gets or sets if this CommandBarControl represents an undoable command.

Declaration
public bool IsUndoable { get; set; }
Property Value
Type Description
bool
Remarks

This property is used to avoid unintended nesting of undoable operations. If it is True, the command will be disabled while any other undoable operation is in progress.

View Source

LargeImage

Gets or sets the control's large (32x32 pixel for 100% display scaling) image

Declaration
public Image LargeImage { get; set; }
Property Value
Type Description
Image
View Source

LargeThemedImage

Gets or sets the control's large image, colored for use in the ribbon according to the current theme.

Declaration
public Image LargeThemedImage { get; set; }
Property Value
Type Description
Image
Remarks

If the themed image is not set explicitly, it is automatically generated from LargeImage if possible.

View Source

ScreenTipImage

Gets or sets the image that will be displayed in the control's ScreenTip

Declaration
public Image ScreenTipImage { get; set; }
Property Value
Type Description
Image
Remarks

The image should not be wider than 100 pixels, otherwise it will be scaled down.

View Source

Tag

Gets or sets a user-defined object for the control

Declaration
public object Tag { get; set; }
Property Value
Type Description
object
View Source

ThemedImage

Gets or sets the control's image, colored for use in the ribbon according to the current theme.

Declaration
public Image ThemedImage { get; set; }
Property Value
Type Description
Image
Remarks

If the themed image is not set explicitly, it is automatically generated from Image if possible.

View Source

Visible

Gets or sets if the CommandBarControl should be visible in the UI or not.

Declaration
public bool Visible { get; set; }
Property Value
Type Description
bool

Methods

View Source

ResolveTarget(IEnumerable<Delegate>)

Given a list of command handlers, resolves which one shall handle the command. This method is called from the CommandBarButton and CommandBarCommandGroup.

Declaration
protected Delegate ResolveTarget(IEnumerable<Delegate> delegates)
Parameters
Type Name Description
IEnumerable<Delegate> delegates

A list with potential handlers.

Returns
Type Description
Delegate

The resolved handler.

View Source

ToString()

Returns a string representation of this

Declaration
public override string ToString()
Returns
Type Description
string
Overrides
object.ToString()

Events

View Source

TrackCommandBarControl

This event is raised when the CommandBarControl is tracked, i.e. the user moves the mouse over the control.

Declaration
public event TrackCommandBarControlEventHandler TrackCommandBarControl
Event Type
Type Description
TrackCommandBarControlEventHandler

See Also

FromID(string)
  • View Source
In this article
Back to top Copyright © 2025 ABB