Layer property page and property sheet
A property sheet is a dialog box that contains one or many property pages. Each property page on the property sheet contains controls to view and allow users to interact with objects by changing the values of their properties without writing code.
This sample shows how to implement and register a custom layer property page (LayerVisibilityPage class) for ArcGIS Desktop in .NET. This property page toggles visibility of the target layer. It also includes a custom command (SimpleLayerPropertiesCmd class) showing how to display a property sheet with a selective number of property pages.
Language: C#, VB Subject: Framework Organization: Esri, http://www.esri.com Date: 11/17/2017 ArcObjects SDK: 10.6 Visual Studio: 2015, 2017 .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
Implement and register a custom layer property page
- Open and compile the sample project in Visual Studio. Set up a debug application if needed.
- Open ArcMap, ArcScene, or ArcGlobe. The custom layer property page works in all of these applications since it is registered in the appropriate layer property page component categories.
- Add a layer to the application.
- Display the layer context menu by right-clicking the layer and selecting Properties. The Properties dialog box appears.
- Activate the custom property page by clicking the Layer Visibility (C#) or Layer Visibility (VB.NET) tab.
- The visibility is controlled by two radio buttons on the page. Toggle visibility to enable the Apply button in the dialog box.
- Click the Apply or OK button to commit the change. The TOC and display are refreshed to reflect the change you made with the custom property page.
- Close the Properties dialog box.
Add the custom command (SimpleLayerPropertiesCmd) that displays the simplified layer property sheet
- Click the Customize menu, and click Customize Mode. The Customize dialog box appears.
- Click the Toolbars tab and select Context Menus.
- Expand and scroll down to Feature Layer Context Menu, and click to expand the menu.
- Click the Commands tab, and drag and drop the Simple Layer Properties (C#) or Simple Layer Properties (VB.NET) command from the .NET Samples category onto the Feature Layer Context Menu.
- Close the dialog box.
- Click the Simple Layer Properties command you just added. The layer context menu displays. The simplified Properties dialog box only shows the Layer Visibility and Symbology pages.
- If necessary, clean up to remove the custom command by resetting the Feature Layer Context Menu in the Customize dialog box.
|Development licensing||Deployment licensing|
|ArcGIS Desktop Basic||ArcGIS Desktop Basic|
|ArcGIS Desktop Standard||ArcGIS Desktop Standard|
|ArcGIS Desktop Advanced||ArcGIS Desktop Advanced|