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.
- Load a map document into the PageLayoutControl.
- Right-click a feature layer to change its symbology.
Additional information
The ITOCControl.HitTest method is used in the OnMouseDown event of the TOCControl to determine whether the type of item clicked implements IGeoFeatureLayer. If the IFeatureClass.ShapeType returns points, lines, or polygons, the IGeoFeatureLayer.Renderer is updated with the symbol selected in the SymbologyControl.
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 MarkerSymbols, LineSymbols, or FillSymbols. The ISymbologyStyleClass.AddItem method is used to add a ServerStyleGalleryItem to the SymbologyControl with its item set to the symbol currently used by IGeoFeatureLayer.Renderer.
Clicking an item displayed in the SymbologyControl passes the selected item to the OnItemSelected event, and the ISymbologyStyleClass.PreviewItem method is used to preview the item in a PictureBox.
AssemblyInfo.cs | Assembly information. |
LayerRendering.cs | Form file. |
SymbolForm.cs | Form file. |
AssemblyInfo.vb | Assembly information. |
LayerRendering.vb | Form file. |
SymbolForm.vb | Form file. |
Download the files for all languages
See Also:
SymbologyControl classISymbologyControl interface
ISymbologyStyleClass interface
Development licensing | Deployment licensing |
---|---|
Engine Developer Kit | Engine |
ArcGIS for Desktop Basic | |
ArcGIS for Desktop Standard | |
ArcGIS for Desktop Advanced |