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


Sample: Implementing a property page for an ArcGIS Engine application (ArcObjects .NET 10.4 SDK)

Implementing a property page for an ArcGIS Engine application


Purpose
This sample demonstrates a mechanism to implement PropertyPages for ArcGIS Engine applications.
This sample contains an implementation of a PropertySheet and a PropertyPage. The object whose properties are controlled by the PropertyPage is any feature layer loaded into the MapControl application. The PropertyPage uses the SymbologyControl to display the marker, line, and fill symbols, which are used to update the symbol used by the renderer of the feature layer. The sample uses the SymbologyControl in conjunction with the MapControl, TOCControl, ToolbarControl, and the control commands.
The following issues are addressed in this sample:
  • Creating a PropertySheet and PropertyPage
  • Registering a PropertyPage to a PropertySheet
  • Connecting an object with its PropertySheet
  • Instantiating and launching a PropertySheet
  • Querying a FeatureRenderer's symbology
  • Loading the StyleFile into the SymbologyControl
  • Getting a selected symbol from the SymbologyControl
  • Applying a new symbol to a FeatureRenderer

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. Start Visual Studio, open the solution, and build the project.
  2. Run the MapControl application.
  3. Add any FeatureLayer with a simple renderer to the map.
  4. Right-click the FeatureLayer in the table of contents to open the context menu with the FeatureLayer symbol properties command.
  5. Select the FeatureLayer symbol properties command to open the PropertySheet.
  6. Select the desired symbol and click Apply to apply the new symbol to the layer.
PropertySheet.cs PropertySheet dialog box implementation file.
PropertySheet.Designer.cs PropertySheet designer file.
SymbolSelectorPropPage.cs PropertyPage dialog box file, containing the SymbologyControl.
FeatureLayerSymbology.cs Command that opens the FeatureLayer's PropertyPage.
TocContextMenuClass.cs ContextMenu hosting the FeatureLayerSymbology command.
frmMain.cs MapControl main application dialog box.
CreateNewDocument.cs Implementation code for creating MapDocuments.
Download the C# files
PropertySheet.vb PropertySheet dialog box implementation file.
PropertySheet.Designer.vb PropertySheet designer file.
SymbolSelectorPropPage.vb PropertyPage dialog box file, containing the SymbologyControl.
FeatureLayerSymbology.vb Command that opens the FeatureLayer's PropertyPage.
TocContextMenuClass.vb ContextMenu hosting the FeatureLayerSymbology command.
frmMain.vb MapControl main application dialog box.
CreateNewDocument.vb Implementation code for creating MapDocuments.
Download the VB.NET files

Download the files for all languages




Additional Requirements
  • This sample uses the PropertyPages.dll assembly, which was written by Robert Simpson. For more information see http://www.codeguru.com/cpp/controls/propertysheet/propertysheetbuttons/article.php/c8545.

Development licensing Deployment licensing
Engine Developer Kit Engine