Allow run time customization of the ToolbarControl


PurposeThis sample demonstrates customizing the ToolbarControl at run time. The ToolbarControl is used in conjunction with the MapControl and the control commands. The AddItem method is used to add new items to the ToolbarControl with their style set. The ICustomizeDialogEvents.OnStartDialog event is used to put the ToolbarControl into customize mode and the ICustomizeDialogEvents.OnCloseDialog event is used to take the ToolbarControl out of customize mode.

Development licensing Deployment licensing
Engine Developer Kit Engine Runtime
ArcView
ArcEditor
ArcInfo

How to use

See Using the samples for help on compiling, setting up the debugger, and running the sample (either an exe or dll).

  1. Check the Customize check box to enable customization of the ToolbarControl and to invoke the Customize dialog box.
  2. To move an item, click it, then drag and drop it to the location indicated by the black vertical bar.
  3. To delete an item, click it, then drag it off the ToolbarControl or right-click the item and click Delete from the Customize menu.
  4. To change the group, group spacing, or style of an item, right-click the item to display the Customize menu.
  5. To add a command, menu, and palette items, double-click them in the Customize dialog box or drag and drop them from the Customize dialog box onto the ToolbarControl.

AssemblyInfo.cs Assembly information.
Customization.cs Form file.
Download the C# files
AssemblyInfo.vb Assembly information.
Customization.vb Form file.
Download the VB.NET files

Download the files for all languages

See Also:

ToolbarControl class
IToolbarControl interface
CustomizeDialog class
ICustomizeDialog interface
ICustomizeDialogEvents interface