ArcObjects Library Reference (Carto)  

IMapDocument.ActiveView Property

The ActiveView of the map document.

[Visual Basic .NET]
Public ReadOnly Property ActiveView As IActiveView
[C#]
public IActiveView ActiveView {get;}
[C++]
HRESULT get_ActiveView(
  IActiveView** ppActiveView
);
[C++]

Parameters

ppActiveView [out, retval]

  ppActiveView is a parameter of type IActiveView

Product Availability

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

Description

Returns the ActiveView of the MapDocument that is open. This can can be a PageLayout or a Map. If a map document (*.mxd) is Open the ActiveView will be the map or page layout that was the ActiveView when the document was last saved. If a Published Map File (*.pmf) is Open the ActivewView will be the default view specified at the time the document was published. If a layer file (*.lyr) is Open the ActiveView will be a map.

Remarks

When working with the IActiveView interface on a MapDocument object, you should always first call IActiveView::Activate() in order to properly initialize the display of the PageLayout or Map object.  If your application has a user interface, you should call Activate() with the hWnd of the application's client area.  If your application runs in the background and has no windows, you can always get a valid hWnd from the GDI GetDesktopWindow() function, part of the Win32 API.

See Also

IMapDocument Interface

.NET Related Topics

How to add different types of layers to a map | How to add display caching | How to create a mosaic layer | How to create AOIs and bookmarks | How to use symbol level drawing | Performing basic map functions | Publisher