ArcObjects Library Reference (Carto)  

IGraphicsContainer.AddElement Method

Add a new graphic element to the layer.

[Visual Basic .NET]
Public Sub AddElement ( _
    ByVal Element As IElement, _
    ByVal zorder As Integer _
)
[C#]
public void AddElement (
    IElement Element,
    int zorder
);
[C++]
HRESULT AddElement(
  IElement* Element,
  long zorder
);
[C++]

Parameters

Element [in]

  Element is a parameter of type IElement

zorder [in]   zorder is a parameter of type long

Product Availability

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

Description

This method adds the input element the graphics container referenced.  The parameter zorder is currently not utilized by all of the IGraphicsContainer implementations and is typically set to 0 when calling this method.

See Also

IGraphicsContainer Interface

.NET Snippets

Add North Arrow | Add Legend | Add Graphics Layer to Globe | Add Graphic to Map | Create Graphic Buffers around Selected Features |

.NET Samples

Create a custom tool (Code Files: DrawGraphicLine) | Custom UI elements using add-ins (Code Files: AddGraphicsTool) | Geodesy MapControl (Code Files: GeodesyMapControl) | Geoevents in a MapControl (Code Files: GeoEvents) | Move a graphic along a path in ArcMap (Code Files: MapGraphicKeyframe) | StreetMap routing (Code Files: RoutingForm) | Visualizing the camera path while animating (Code Files: VisualizeCameraPath) |

.NET Related Topics

Adjusting feature locations with spatial adjustment | Create a custom tool | Working with map surrounds | Working with PageLayout elements |