ArcGIS Pro 2.9 API Reference Guide
RemoveElements Method (GraphicElementContainer)

ArcGIS.Desktop.Layouts Namespace > GraphicElementContainer Class : RemoveElements Method
The elements being removed
Remove the elements. This method must be called on the MCT. Use QueuedTask.Run.
Syntax
public void RemoveElements( 
   IEnumerable<Element> elements
)
Public Sub RemoveElements( _
   Optional ByVal elements As IEnumerable(Of Element) _
) 

Parameters

elements
The elements being removed
Exceptions
ExceptionDescription
This method or property must be called within the lambda passed to QueuedTask.Run.
Remarks
If elements is null then all elements are removed.
If a group element is provided in the list of elements to be removed then the group element and all its children will be removed.
If a child of a group element is provided in the list in addition to its parent then the parent takes precedence (i.e. the entire group element is removed and not just that child).
Requirements

Target Platforms: Windows 11, Windows 10, Windows 8.1

See Also

Reference

GraphicElementContainer Class
GraphicElementContainer Members