Layer property page and property sheet


Purpose
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.

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.

Implement and register a custom layer property page
  1. Open and compile the sample project in Visual Studio. Set up a debug application if needed.
  2. 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.
  3. Add a layer to the application.
  4. Display the layer context menu by right-clicking the layer and selecting Properties. The Properties dialog box opens.
  5. Activate the custom property page by clicking the Layer Visibility (C#) or Layer Visibility (VB.NET) tab.
  6. The visibility is controlled by two radio buttons on the page. Toggle visibility to enable the Apply button in the dialog box.
  7. 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.
  8. Close the Properties dialog box.

Add the custom command (SimpleLayerPropertiesCmd) that displays the simplified layer property sheet
  1. Click the Customize menu, and click Customize Mode. The Customize dialog box opens.
  2. Click the Toolbars tab and select Context Menus.
  3. Expand and scroll down to Feature Layer Context Menu, and click to expand the menu.
  4. 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.
  5. Close the dialog box.
  6. 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.
  7. If necessary, clean up to remove the custom command by resetting the Feature Layer Context Menu in the Customize dialog box.

LayerVisibilityPage.cs User control implementing a custom property page for layer visibility.
SimpleLayerPropertiesCmd.cs Command displaying a simplified layer property sheet.
Download the C# files
LayerVisibilityPage.vb User control implementing a custom property page for layer visibility.
SimpleLayerPropertiesCmd.vb Command displaying a simplified layer property sheet.
Download the VB.NET files

Download the files for all languages




Development licensing Deployment licensing
ArcView ArcView
ArcEditor ArcEditor
ArcInfo ArcInfo