Create a custom selection extension by extending ArcObjects


Purpose
This sample demonstrates how to create ArcGIS Desktop user interface (UI) components by extending ArcObjects. The sample is based on a selection theme, but it also shows multiple ArcObjects components working together. It contains an extension, a dockview, a toolbar with a combo box, a tool palette, a multiItem, several buttons and tools, and a menu. The sample also has several event handlers.

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. Build the solution.
  2. Start ArcMap and add some data.
  3. Click the Customize menu, select Toolbars, and click the Selection COM toolbar.
  4. Click the Customize menu and click Extensions. The Extensions dialog box opens.
  5. Select the Selection Sample Extension option.
  6. Use the toggle button to show the dockable window.
  7. Make a selection using one of the tools.
  8. Optionally, use the combo box to choose target selection layers.
  9. Optionally, click the Zoom to layer menu to zoom to a selected layer.
  10. The dockable window will report the selected features count.

SelectByLineTool.cs Selection tool.
SelectionCountDockWin.cs Dockable window reporting the count of selected features.
ToggleDockWinBtn.cs Button to toggle the dockable window.
SelectionExtension.cs Main extension.
SelectionMenu.cs Menu containing selection commands.
SelectionTargetComboBox.cs Combo box containing target layers.
SelectionToolbar.cs Main toolbar.
SelectionToolPalette.cs Tool palette containing a set of selection tools.
SelectionZoomToLayerMenu.cs Menu containing the multiItem.
ZoomToLayerMultiItem.cs MultiItem containing layers.
Download the C# files
SelectByLineTool.vb Selection tool.
SelectionCountDockWin.vb Dockable window reporting the count of selected features.
ToggleDockWinBtn.vb Button to toggle the dockable window.
SelectionExtension.vb Main extension.
SelectionMenu.vb Menu containing selection commands.
SelectionTargetComboBox.vb Combo box containing target layers.
SelectionToolbar.vb Main tool bar.
SelectionToolPalette.vb Tool palette containing a set of selection tools.
SelectionZoomToLayerMenu.vb Menu containing the multiItem.
ZoomToLayerMultiItem.vb MultiItem containing layers.
Download the VB.NET files

Download the files for all languages




Development licensing Deployment licensing
ArcView ArcView
ArcEditor ArcEditor
ArcInfo ArcInfo