ArcGIS Pro 2.6 API Reference Guide
FindElement Method (GraphicsLayerExtensions)

ArcGIS.Desktop.Mapping Namespace > GraphicsLayerExtensions Class : FindElement Method
The graphics layer being extended
The name of the element to find. Cannot be null
Finds the element recursively with the given name within the GraphicsLayer collection. This method must be called on the MCT. Use QueuedTask.Run
Syntax
public static Element FindElement( 
   GraphicsLayer graphicsLayer,
   string elementName
)
Public Shared Function FindElement( _
   ByVal graphicsLayer As GraphicsLayer, _
   ByVal elementName As String _
) As Element

Parameters

graphicsLayer
The graphics layer being extended
elementName
The name of the element to find. Cannot be null

Return Value

The ArcGIS.Desktop.Layouts.Element or null if it is not found
Exceptions
ExceptionDescription
This method or property must be called within the lambda passed to QueuedTask.Run.
Value cannot be null: elementName
Remarks
Find recurses nested groups to find the given element.
The map view displaying the graphics layer should be initialized.
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 7

See Also

Reference

GraphicsLayerExtensions Class
GraphicsLayerExtensions Members