ArcObjects Library Reference  (Carto)    

IGraphicsLayer Interface

Provides access to members that control the Graphics Layer.

Product Availability

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

When To Use

A graphics layer can be associated with another layer in the map; when that other layer changes visibility, the graphics layer can change visibility also. Use the IGraphicsLayer interface to manage this.

The IGraphicsLayer interface also has methods to activate and deactivate the graphics layer. When a graphics layer is active, it is the current annotation target.


Method Activate Prepare to display graphic on screen.
Read/write property AssociatedLayer Layer that is associated with this graphics layer.
Method Deactivate ActiveView that graphics are displayed on is no longer visible.
Read/write property UseAssociatedLayerVisibility Indicates if the layer that is associated with this graphics layer controls the visibility.

CoClasses that implement IGraphicsLayer

CoClasses and Classes Description
CompositeGraphicsLayer A collection of graphics layers that behave like single layer.
FDOGraphicsLayer A collection of properties for an annotation layer (feature data object graphics layer).
GlobeGraphicsLayer (esriGlobeCore) The Globe Graphics Layer.
GraphicsLayer3D (esri3DAnalyst) A 3D Graphics Layer.
GraphicsSubLayer Graphic sublayer handed back by the composite graphics layer.
[Visual Basic 6.0]

The following example is a code excerpt that shows how to get a reference to an IGraphicsLayer interface with Visual Basic.

'This example assumes that you already have an IMap (pMap) set

  ' get IGraphicsLayer
  Dim pGraLyr As IGraphicsLayer
  Set pGraLyr = pMap.ActiveGraphicsLayer

See Also

IMap Interface