ArcObjects Library Reference

Add Map Commands to ToolbarControl Snippet

Add Map Commands to ToolbarControl

[C#]

///<summary>Add Map Commands to ToolbarControl.</summary>
///  
///<param name="toolbarControl">An IToolbarControl inferface  to add map commands to.</param>
///   
///<remarks></remarks>
public void AddMapCommandsToToolbarControl(ESRI.ArcGIS.Controls.IToolbarControl toolbarControl)
{
  toolbarControl.AddToolbarDef("esriControls.ControlsMapNavigationToolbar", -1, false, 0, ESRI.ArcGIS.SystemUI.esriCommandStyles.esriCommandStyleIconOnly);
  toolbarControl.AddItem("esriControls.ControlsMapIdentifyTool", -1, -1, true, 0, ESRI.ArcGIS.SystemUI.esriCommandStyles.esriCommandStyleIconOnly);
  toolbarControl.AddItem("esriControls.ControlsMapFindCommand", -1, -1, false, 0, ESRI.ArcGIS.SystemUI.esriCommandStyles.esriCommandStyleIconOnly);
  toolbarControl.AddItem("esriControls.ControlsMapHyperlinkTool", -1, -1, false, 0, ESRI.ArcGIS.SystemUI.esriCommandStyles.esriCommandStyleIconOnly);
  toolbarControl.AddItem("esriControls.ControlsMapMeasureTool", -1, -1, false, 0, ESRI.ArcGIS.SystemUI.esriCommandStyles.esriCommandStyleIconOnly);
  toolbarControl.AddItem("esriControls.ControlsLayerListToolControl", -1, -1, false, 0, ESRI.ArcGIS.SystemUI.esriCommandStyles.esriCommandStyleIconOnly);
  toolbarControl.AddItem("esriControls.ControlsLayerTransparencyCommand", -1, -1, false, 0, ESRI.ArcGIS.SystemUI.esriCommandStyles.esriCommandStyleIconOnly);
  toolbarControl.AddItem("esriControls.ControlsMapSwipeTool", -1, -1, false, 0, ESRI.ArcGIS.SystemUI.esriCommandStyles.esriCommandStyleIconOnly);
}
[Visual Basic .NET]

'''<summary>Add Map Commands to ToolbarControl.</summary>
'''  
'''<param name="toolbarControl">An IToolbarControl inferface  to add map commands to.</param>
'''   
'''<remarks></remarks>
Private Sub AddMapCommandsToToolbarControl(ByVal toolbarControl As ESRI.ArcGIS.Controls.IToolbarControl)

  toolbarControl.AddToolbarDef("esriControls.ControlsMapNavigationToolbar", -1, False, 0, ESRI.ArcGIS.SystemUI.esriCommandStyles.esriCommandStyleIconOnly)
  toolbarControl.AddItem("esriControls.ControlsMapIdentifyTool", -1, -1, True, 0, ESRI.ArcGIS.SystemUI.esriCommandStyles.esriCommandStyleIconOnly)
  toolbarControl.AddItem("esriControls.ControlsMapFindCommand", -1, -1, False, 0, ESRI.ArcGIS.SystemUI.esriCommandStyles.esriCommandStyleIconOnly)
  toolbarControl.AddItem("esriControls.ControlsMapHyperlinkTool", -1, -1, False, 0, ESRI.ArcGIS.SystemUI.esriCommandStyles.esriCommandStyleIconOnly)
  toolbarControl.AddItem("esriControls.ControlsMapMeasureTool", -1, -1, False, 0, ESRI.ArcGIS.SystemUI.esriCommandStyles.esriCommandStyleIconOnly)
  toolbarControl.AddItem("esriControls.ControlsLayerListToolControl", -1, -1, False, 0, ESRI.ArcGIS.SystemUI.esriCommandStyles.esriCommandStyleIconOnly)
  toolbarControl.AddItem("esriControls.ControlsLayerTransparencyCommand", -1, -1, False, 0, ESRI.ArcGIS.SystemUI.esriCommandStyles.esriCommandStyleIconOnly)
  toolbarControl.AddItem("esriControls.ControlsMapSwipeTool", -1, -1, False, 0, ESRI.ArcGIS.SystemUI.esriCommandStyles.esriCommandStyleIconOnly)

End Sub


Additional Requirements
  • The code in this document requires the following References added to the Visual Studio project:
  • ESRI.ArcGIS.Controls
  • ESRI.ArcGIS.SystemUI