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.
- Open and compile the solution.
- Start ArcMap and open a map document with a layer or add a layer to a new map document.
- Add the ZoomToLayer command to a toolbar. It will be in the Developer Samples category, with the name of Zoom To Layer C# (C# version) or Zoom To Layer VB .NET (VB .NET version).
- Select a layer in the table of contents (TOC).
- Click the ZoomToLayer command button to zoom to the extent of the layer selected in the TOC.
CommandInheritingBaseCommand/ZoomToLayer.cs | Zoom to the active layer in the TOC. |
CommandInheritingBaseCommand/ZoomToLayer.vb | Zoom to the active layer in the TOC. |
Download the files for all languages
See Also:
Walkthrough: Create a command by inheriting from BaseCommandCreating commands and tools
Development licensing | Deployment licensing |
---|---|
ArcView | ArcView |
ArcEditor | ArcEditor |
ArcInfo | ArcInfo |