Provides access to members that define a toolbar.
When To Use
The IToolbarDef interface is used to define the properties of a custom toolbar. When creating your own toolbar, you would implement the IToolBarDef interface in your class code. You can set the caption and name of the toolbar and specify what commanditems are on the toolbar.
|The caption of this toolbar.
|The CLSID for the item on this toolbar at the specified index.
|The number of items in this toolbar.
|The name of this toolbar.
CoClasses that implement IToolBarDef
|CoClasses and Classes
|Provides access to the engine editing toolbar.
|A toolbar with common selection tools.
|A toolbar with common globe control tools.
|A toolbar with tools to spin or rotate globe.
|A toolbar with common tools to draw graphic elements.
|A toolbar with tools which manipulate ink.
|A toolbar with common tools to navigate map.
|Engine Network Analyst Toolbar.
|A toolbar with common tools working with pagelayout view.
|A toolbar with common scene control tools.
|A toolbar with common snapping commands.
The command bars collection uses command bar definitions (either ToolBarDef or MenuDef) to create command bars. For example, a class that implements IToolbarDef is only a definition for a toolbar; it is not actually a toolbar object. Once this class is registered in one of the command bar component categories, the command bars collection uses the definition of the toolbar in your class to create the actual command bar.
When an end user installs your custom toolbar, you may want this toolbar immediately available in the application so that the user doesn't have to manually display that toolbar before using it. You can add a registry setting to make this toolbar automatically appear the first time the application is run after the installation of your toolbar. In the setup program for your toolbar, you can create a new key under:
The key name should be the CLSID of the toolbar. You don't have to set a value for this key.
This graphic shows that a custom toolbar has been added to PremierToolbars in the registry.
The PremierToolbars setting is only used the first time the application is started; if the user subsequently hides the toolbar, no further attempts will be made to show the toolbar on application startup. After the application is started once the value of your PremierToolbars key is set to 1 and is then ignored by the application.
If you are working in Visual Basic you can use the ESRI Compile and Register Add-in to set up this registry key.