This document is archived and information here might be outdated.  Recommended version.


Add Page Layout Commands to ToolbarControl Snippet (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference

Add Page Layout Commands to ToolbarControl Snippet

Add Page Layout Commands to ToolbarControl

[C#]
///<summary>Add Page Layout Commands to ToolbarControl</summary>
///  
///<param name="toolbarControl">An IToolbarControl interface to which Page Layout Controls will be added.</param>
///   
///<remarks></remarks>
public void AddPageLayoutCommandsToToolbarControl(ESRI.ArcGIS.Controls.IToolbarControl toolbarControl)
{

  // Call to add the page layout commands to the ToolbarControl
  // For example, if a ToolbarControl named axToolbarControl1 exists use the following code:
  // AddPageLayoutCommandsToToolbarControl(axToolbarControl1.Object as ESRI.ArcGIS.Controls.IToolbarControl); 

  toolbarControl.AddToolbarDef("esriControls.ControlsPageLayoutToolbar", -1, false, 0, ESRI.ArcGIS.SystemUI.esriCommandStyles.esriCommandStyleIconOnly);
}
[Visual Basic .NET]
'''<summary>Add Page Layout Commands to ToolbarControl</summary>
'''  
'''<param name="toolbarControl">An IToolbarControl interface to which Page Layout Controls will be added.</param>
'''   
'''<remarks></remarks>
Public Sub AddPageLayoutCommandsToToolbarControl(ByVal toolbarControl As ESRI.ArcGIS.Controls.IToolbarControl)

  ' Call to add the page layout commands to the ToolbarControl
  ' For example, if a ToolbarControl named AxToolbarControl1 exists use the following code:
  ' AddPageLayoutCommandsToToolbarControl(AxToolbarControl1.Object)

  toolbarControl.AddToolbarDef("esriControls.ControlsPageLayoutToolbar", -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