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.
Language: C#, VB
Subject: Controls
Organization: Esri, http://www.esri.com
Date: 10/17/2019
ArcObjects SDK: 10.8
Visual Studio: 2017, 2019
.NET Target Framework: 4.5
- ArcObjects .NET API Reference online
- Sample Data Download
- What's new
- Download the ArcObjects SDK for .Net from MyEsri.com
- Select TextSymbol from the SymbologyControl.
- Add the text and select the text font size.
- Right-click the PageLayoutControl to add a text element.
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.
SymbologyControl class
ISymbologyControl interface
ISymbologyStyleClass interface
Development licensing | Deployment licensing |
---|---|
Engine Developer Kit | Engine |
ArcGIS Desktop Basic | |
ArcGIS Desktop Standard | |
ArcGIS Desktop Advanced |