This document is archived and information here might be outdated.  Recommended version.


IActiveView.Extent Property (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (Carto)  

IActiveView.Extent Property

The visible extent rectangle.

[Visual Basic .NET]
Public Property Extent As IEnvelope
[C#]
public IEnvelope Extent {get; set;}
[C++]
HRESULT get_Extent(
  IEnvelope** Extent
);
[C++]
HRESULT put_Extent(
  IEnvelope* Extent
);
[C++]

Parameters Extent [out, retval]
Extent is a parameter of type IEnvelope Extent [in]
Extent is a parameter of type IEnvelope

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Remarks

The Extent property holds the visible area of the view.  The Extent is automatically captured whenever the view's transformation changes.  For example, when the active view is a Map, the Extent is modified whenever the spatial reference changes.  Also, the Extent is set the first time a layer is added to a Map.  In layout view, the Extent is initially set to the page size.  In both layout view and data view, zooming in our out changes the Extent. 

The Extent is always adjusted to fit the device frame and it is persisted in the map document.

See Also

IActiveView Interface | IActiveView.Extent Property | IDisplayTransformation.FittedBounds Property | IDisplayTransformation.VisibleBounds Property | IFeatureClassManage Interface | IFeatureClassManage.UpdateExtent Method | ITin.Extent Property

.NET Snippets

Zoom by Ratio and Recenter | Add Shapefile Using OpenFileDialog | Set Max Extent On Spatial Domain | Zoom by Ratio | Zoom to Layer by Index Number | Zoom to Active Layer in TOC

.NET Samples

Add a custom menu created in .NET to ArcGIS for Desktop (Code Files: AddShapefile) | Custom reshape polyline edit task (Code Files: ReshapePolylineEditTask) | Custom UI elements using add-ins (Code Files: ZoomToLayerButton) | Copy the PageLayoutControl focus map and overwrite the MapControl map (Code Files: CopyFocusMap) | Building a MapViewer application using the ArcGIS Engine controls (Code Files: MapViewer) | StreetMap routing (Code Files: RoutingForm) | RSS weather layer (Code Files: WeatherItemSelectionDlg) | Create a command by inheriting from BaseCommand (Code Files: ZoomToLayer)

.NET Related Topics

Adding a custom menu created in .NET to ArcGIS for Desktop | Building a map viewing application using the ArcGIS Engine controls | Create a command by inheriting from BaseCommand | How to create AOIs and bookmarks | How to create dynamic menu commands using a MultiItem | Working with the edit sketch