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


ICommandItem Interface (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (Framework)  

ICommandItem Interface

Provides access to members that define a command item.

Product Availability

Available with ArcGIS Desktop.

When To Use

A CommandItem is any item on a commandbar. For example, buttons, tools, and menu items that appear on commandbars are all commanditems. The ICommandItem interface allows you to get or set the properties of the commanditem such as caption, button image, statusbar message, tooltip, display style, help context ID, and more. The ICommandItem interface also provides methods to execute, delete, refresh, and reset the commanditem. Use ICommandBars::Find, ICommandBar::Find, or ICommandBar::Item to obtain a reference to a particular commanditem.

Members

Description
Read/write property Action The name of the VBA macro this command should run when pressed.
Read-only property BuiltIn Indicates whether this command item is built-in or if it was implemented through VBA.
Read/write property Caption The caption of this command item.
Read-only property Category The name of the category with which this command item is associated.
Read-only property Command A reference to the internal command object.
Method Delete Removes this object from the commandbar.
Method Execute Causes the command to execute.
Read/write property FaceID The bitmap that is used as the icon on this command item.
Read/write property Group Indicates if this command item begins a menu or toolbar group.
Read/write property HelpContextID The help context ID associated with this command item.
Read/write property HelpFile The help file associated with this command item.
Read-only property ID The unique integer ID associated with this command item.
Read-only property Index The positional index of this command item within its menu or toolbar.
Read/write property Message The status bar message for this command item.
Read/write property Name The name of this command item.
Read-only property Parent The menu or toolbar that this command item currently resides on.
Method Refresh Causes the command to be redrawn.
Method Reset Restores this command item's properties to that of the original.
Read/write property Style The display style of this command item.
Read/write property Tag The tag for this command item.
Read/write property Tooltip The tooltip for this command item.
Read-only property Type The type of this command item.

CoClasses that implement ICommandItem

CoClasses and Classes Description
CommandBar CommandBar object.
CommandItem Command Item.

See Also

ICommandBar.Popup Method | ICommandBar.CreateMacroItem Method | ICommandBar.Add Method | ICommandBar.Find Method | ICommandBar.Item Property | ICommandBars.Find Method

.NET Snippets

Get Command by Name | List ArcMap Visible Toolbars | Use Custom Tool on Windows Form | Find Command and Execute | Set Tool Active in ToolBar | Statements - Use a Tool in a Windows Form | Get Command on Toolbar by Names | Get Toolbar by Name

.NET Samples

Custom subtyped command and tool (Code Files: ZoomInCommands) | Applying user interface customizations at startup (Code Files: AcmeExt) | Simple logging dockable window with a custom context menu (Code Files: LoggingDockableWindow)

.NET Related Topics

How to create multiple commands or tools in a single class subtyped command