Tabbed feature inspector


Purpose
This sample demonstrates how to create a custom object inspector. Custom object inspectors allow you to control the information that's returned to the user when selected features are inspected. The custom inspector calculates and reports the area and perimeter for the selected polygons, length, and coordinates for selected lines and points. It also reports the total number of selected features.
The custom information is shown in the second panel of a tabbed control. The first panel of the control shows the standard information for the feature. A command button is also created for the extension classid value to be added to the feature class so it can recognize the extension.

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 file, and build the project.
  2. Register the sample with ESRIRegAsm.exe.
  3. Start ArcMap and add the Editor toolbar.
  4. Click the Customize menu, click Customize Mode, and click the Commands tab.
  5. Under Categories, scroll down, and click Developer Samples.
  6. Under Commands, select the AddEXTCLSID command, and drag it to an available toolbar.
  7. Click the command, browse to the personal or file geodatabase feature class you want to use, and click Add.
  8. Load the feature class you selected with the AddEXTCLSID command onto the map.
  9. Start an edit session and use the Edit tool to select several features.
  10. Click the Attributes tool on the Editor toolbar. The Attributes dialog box opens. The custom inspector appears in the right-hand window of the Attributes dialog box whenever you inspect features belonging to the customized feature class. The default feature inspector shows for features belonging to any other feature class added to the map.
  11. Click a single feature ID (FID) in the tree view; its properties are reported.

Additional information

The AddEXTCLSID command is included in the sample to enable testing of the feature inspector on different geodatabase feature classes. This command adds a globally unique identifier (GUID) from the tabbed inspector class to the extension class identifier (EXTCLSID) parameter of the feature class. This is so ArcMap can ensure the objects or feature classes implement the instance and the class extension behavior (use the tabbed inspector instead of the normal inspector). The IClassSchemaEdit interface contains the AlterClassExtensionCLSID method to do this work.

TabbedInspector.cs User Control Class file demonstrating how to build a custom inspector.
TabbedInspector.Designer.cs File containing user control design information.
AssemblyInfo.cs Assembly information of the project.
AddEXTCLSID.cs Class file containing the command to add the extension ID to the feature class.
Download the C# files
ObjectInspector.vb Class file demonstrating how to build a custom inspector; inherits the feature inspector user control.
My Project/AssemblyInfo.vb Located in the MyProject folder along with other files containing assembly information.
AddEXTCLSID.vb Class file containing the command to add the extension ID to the feature class.
Download the VB.NET files

Download the files for all languages




Development licensing Deployment licensing
ArcGIS for Desktop Basic ArcGIS for Desktop Basic
ArcGIS for Desktop Standard ArcGIS for Desktop Standard
ArcGIS for Desktop Advanced ArcGIS for Desktop Advanced