This document is archived and information here might be outdated.  Recommended version.


ICommandBar.Add Method (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (Framework)  

ICommandBar.Add Method

Adds a new command to this commandbar.

[Visual Basic .NET]
Public Function Add ( _
    ByVal cmdID As UID, _
    [ByRef Index As Object] _
) As ICommandItem
[C#]
public ICommandItem Add (
    UID cmdID,
    ref object Index
);
[C#]

Optional Values

Index   To indicate that this parameter is undefined, first define a variable object Missing=Type.Missing; then pass this in as ref Missing.

Product Availability

Available with ArcGIS Desktop.

Description

 

cmdID specifies the unique identifier of the command that is to be added to the commandbar.

Index specifies the postion on the commandbar at which this item is to be added. [Optional]

 

Remarks

In VBA, you can use the built-in ArcID module to find the unique identifier for a particular command or commandbar.

See Also

ICommandBar Interface | ICommandItem Interface | IUID Interface

.NET Snippets

Create Context Menu