Control text symbols using the SymbologyControl


Purpose
This sample demonstrates using the SymbologyControl to display text symbols that control the style of text elements. The sample uses the SymbologyControl in conjunction with the PageLayoutControl, 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. Select TextSymbol from the SymbologyControl.
  2. Add the text and select the text font size.
  3. Right-click the PageLayoutControl to add a text element.

Additional information

The LoadStyleFile method is used in the Form_Load event of the SymbolForm to add the contents of the ESRI.ServerStyle into the SymbologyControl. The StyleClass property is used to display text symbols in the SymbologyControl. When an item is selected by the end user from the SymbologyControl, a ServerStyleGalleryItem is returned.
The IPageLayoutControlEvents.OnMouseDown event is used to add a TextElement to the GraphicsContainer of the PageLayout when right-clicked. The ITextElement.Symbol is set to the IStyleGalleryItem.Item property.


AssemblyInfo.cs Assembly information.
TextSymbols.cs Form file.
SymbolForm.cs Form file.
Download the C# files
AssemblyInfo.vb Assembly information.
TextSymbols.vb Form file.
SymbolForm.vb Form 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