ArcObjects Library Reference (Carto)  

IActiveView.GraphicsContainer Property

The active graphics container.

[Visual Basic .NET]
Public ReadOnly Property GraphicsContainer As IGraphicsContainer
[C#]
public IGraphicsContainer GraphicsContainer {get;}
[C++]
HRESULT get_GraphicsContainer(
  IGraphicsContainer** GraphicsContainer
);
[C++]

Parameters

GraphicsContainer [out, retval]

  GraphicsContainer is a parameter of type IGraphicsContainer

Product Availability

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

Remarks

Both the Map and PageLayout objects are graphics containers - both implement the IGraphicsContainer interface. 

The Map has a Basics Graphics Layer and this property returns a reference to that object (see CompositeGraphicsLayer and IMap::BasicGraphicsLayer).  When working with a Map object, you can also perform a query interface from any of the interfaces the Map implements, IMap for example, to IGraphicsContainer.  The QI also takes you to the CompositeGraphicsLayer object.  These are both possible because the Map aggregates the Basic Graphics Layer.

The PageLayout object works differently.  The PageLayout does not have a Basics Graphics Layer; instead, the PageLayout object is its own graphics container having its own implementation of IGraphicsContainer.  A QI from IPageLayout to IGraphicsContainer connects you with the graphics container associated strictly with the PageLayout. However, this property, IActiveView::GraphicsContainer, on the PageLayout object has two possible outcomes.  If a Map is activated (IActiveView::IsMapActivated), the property will return a reference to the focus Map's active graphics layer (IMap::ActiveGraphicsLayer ).  If no Map is activated, the property will return a reference to the PageLayout's graphics container - the same as the QI case.

See Also

IActiveView Interface