ArcObjects Library Reference

Add Globe Commands to ToolbarControl Snippet

Add Globe Commands to ToolbarControl.

[C#]

///<summary>Add Globe Commands to ToolbarControl</summary>
///  
///<param name="toolbarControl">An IToolbarControl interface to add Globe commands to.</param>
///   
///<remarks></remarks>
public void AddGlobeCommandsToToolbarControl(ESRI.ArcGIS.Controls.IToolbarControl toolbarControl)
{
  // Call to add the globe commands to the ToolbarControl
  // For example, if a ToolbarControl named axToolbarControl1 exists use the following code:
  // AddGlobeCommandsToToolbarControl(axToolbarControl1.Object as ESRI.ArcGIS.Controls.IToolbarControl); 

  toolbarControl.AddToolbarDef("esriControls.ControlsGlobeGlobeToolbar", -1, false, 0, ESRI.ArcGIS.SystemUI.esriCommandStyles.esriCommandStyleIconOnly);
  toolbarControl.AddItem("esriControls.ControlsGlobeIdentifyTool", -1, -1, true, 0, ESRI.ArcGIS.SystemUI.esriCommandStyles.esriCommandStyleIconOnly);
  toolbarControl.AddItem("esriControls.ControlsGlobeFindCommand", -1, -1, false, 0, ESRI.ArcGIS.SystemUI.esriCommandStyles.esriCommandStyleIconOnly);
  toolbarControl.AddItem("esriControls.ControlsGlobeHyperlinkTool", -1, -1, false, 0, ESRI.ArcGIS.SystemUI.esriCommandStyles.esriCommandStyleIconOnly);
  toolbarControl.AddItem("esriControls.ControlsGlobeMeasureTool", -1, -1, false, 0, ESRI.ArcGIS.SystemUI.esriCommandStyles.esriCommandStyleIconOnly);
  toolbarControl.AddItem("esriControls.ControlsGlobeSwipeTool", -1, -1, false, 0, ESRI.ArcGIS.SystemUI.esriCommandStyles.esriCommandStyleIconOnly);
  toolbarControl.AddToolbarDef("esriControls.ControlsGlobeRotateToolbar", -1, true, 0, ESRI.ArcGIS.SystemUI.esriCommandStyles.esriCommandStyleIconOnly);
}
[Visual Basic .NET]

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

  ' Call to add the globe commands to the ToolbarControl
  ' For example, if a ToolbarControl named axToolbarControl1 exists use the following code:
  ' AddGlobeCommandsToToolbarControl(AxToolbarControl1.Object) 

  toolbarControl.AddToolbarDef("esriControls.ControlsGlobeGlobeToolbar", -1, False, 0, ESRI.ArcGIS.SystemUI.esriCommandStyles.esriCommandStyleIconOnly)
  toolbarControl.AddItem("esriControls.ControlsGlobeIdentifyTool", -1, -1, True, 0, ESRI.ArcGIS.SystemUI.esriCommandStyles.esriCommandStyleIconOnly)
  toolbarControl.AddItem("esriControls.ControlsGlobeFindCommand", -1, -1, False, 0, ESRI.ArcGIS.SystemUI.esriCommandStyles.esriCommandStyleIconOnly)
  toolbarControl.AddItem("esriControls.ControlsGlobeHyperlinkTool", -1, -1, False, 0, ESRI.ArcGIS.SystemUI.esriCommandStyles.esriCommandStyleIconOnly)
  toolbarControl.AddItem("esriControls.ControlsGlobeMeasureTool", -1, -1, False, 0, ESRI.ArcGIS.SystemUI.esriCommandStyles.esriCommandStyleIconOnly)
  toolbarControl.AddItem("esriControls.ControlsGlobeSwipeTool", -1, -1, False, 0, ESRI.ArcGIS.SystemUI.esriCommandStyles.esriCommandStyleIconOnly)
  toolbarControl.AddToolbarDef("esriControls.ControlsGlobeRotateToolbar", -1, True, 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