Add map surrounds using the SymbologyControl


Purpose
This sample demonstrates using the SymbologyControl to display north arrow, scale bar, and scale text symbols, which are used by custom commands when adding MapSurround objects to the GraphicsContainer of the PageLayout. The sample uses the SymbologyControl in conjunction with the PageLayoutControl, TOCControl, ToolbarControl, and the controls commands.

How to use

See How to use ArcGIS samples for help on compiling, setting up the debugger, and running the sample. If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.

  1. Load a map document into the PageLayoutControl.
  2. Use the palette to add map surrounds to the page.

Additional information

In the Form_Load event of the SymbolForm, the LoadStyleFile method is used to add the contents of the ESRI.ServerStyle into the SymbologyControl, and the StyleClass property is used to display MarkerNorthArrow, Scalebar, and ScaleText symbols.
Clicking an item displayed in the SymbologyControl fires the OnItemSelectedEvent. The ITool.OnMouseUp events of the custom commands are used to add MapSurroundFrame objects to the GraphicsContainer with the IMapSurroundFrame.MapSurround property set to the IStyleGalleryItem.Item property.


AssemblyInfo.cs Assembly information.
AddMapSurrounds.cs Form file.
SymbolForm.cs Form file.
CreateNorthArrow.cs Class file.
CreateScaleBar.cs Class file.
CreateScaleText.cs Class file.
Download the C# files
AssemblyInfo.vb Assembly information.
AddMapSurrounds.vb Form file.
SymbolForm.vb Form file.
NorthArrows.vb Class file.
ScaleBars.vb Class file.
ScaleText.vb Class file.
Download the VB.NET files

Download the files for all languages

See Also:

SymbologyControl class
ISymbologyControl interface
ISymbologyStyleClass interface




Development licensing Deployment licensing
Engine Developer Kit Engine
ArcGIS for Desktop Basic
ArcGIS for Desktop Standard
ArcGIS for Desktop Advanced