ArcObjects Library Reference (Controls)  

ToolbarMenu CoClass

A menu containing commands that can be used from a ToolbarControl or as a popup menu.

Product Availability

Available with ArcGIS Engine.


A ToolbarMenu supplies the implementation of a menu item that can host Command, Tool, ToolControl, MultiItem and ToolbarPalette objetcs. A ToolbarMenu can either be hosted on the ToolbarControl or can appear as a popup menu.

A ToolbarMenu can be built in two ways. Firstly, an object implementing IMenuDef can be passed to the IToolbarControl::AddItem or IToolbarControl::AddMenuItem method which creates a ToolbarMenu object and populates it from the menu definition. Secondly, the properties and methods on the IToolbarMenu interface can be used to build a menu. Any sub menus on a ToolbarMenu are implemented as another instance of a IToolbarMenu.

Extended Error Information

Use the ISupportErrorInfo method InterfaceSupportsErrorInfo to determine if the object supports extended error information. If the object supports extended error info, VC++ developers should use the OLE/COM IErrorInfo interface to access the ErrorInfo object. Visual Basic developers should use the global error object Err to retrieve this extended error information.


Interfaces Description
ISupportErrorInfo Indicates whether a specific interface can return Automation error objects.
IToolbarMenu Provides access to members that control ToolbarControl menu items.
IToolbarMenu2 Provides access to members that control ToolbarControl menu items.


ToolbarMenu items support accelerator (shortcut) and access keys, defined in the ICommand::Caption property. For example, a 'Close' command with the caption "&Close\tAlt+F4" has the 'ALT+F4' key combination as its shortcut key, and the 'C' key as its access key. Although a shortcut key will always work, an access key will only work when the ToolbarMenu is active.