ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / GraphicsLayerExtensions Class / RemoveElement Method
The graphics layer being extended
The element being removed.

In This Topic
    RemoveElement Method (GraphicsLayerExtensions)
    In This Topic
    Remove the element from the GraphicsLayer collection. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Shared Sub RemoveElement( _
       ByVal graphicsLayer As GraphicsLayer, _
       ByVal element As Element _
    ) 
    public static void RemoveElement( 
       GraphicsLayer graphicsLayer,
       Element element
    )

    Parameters

    graphicsLayer
    The graphics layer being extended
    element
    The element being removed.
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Value cannot be null: element
    Remarks
    Removing a group element removes its children.
    The map view displaying the graphics layer should be initialized.
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also