ArcGIS Pro 2.9 API Reference Guide
SelectElements(IReadOnlyList<Element>) Method
Example 

ArcGIS.Desktop.Layouts Namespace > LayoutView Class > SelectElements Method : SelectElements(IReadOnlyList<Element>) Method
A list of existing layout elements.
Set the selected layout elements for the layout view. This method must be called on the MCT. Use QueuedTask.Run.
Syntax
public void SelectElements( 
   IReadOnlyList<Element> elements
)
Public Overloads Sub SelectElements( _
   ByVal elements As IReadOnlyList(Of Element) _
) 

Parameters

elements
A list of existing layout elements.
Exceptions
ExceptionDescription
This method or property must be called within the lambda passed to QueuedTask.Run.
elements must belong to layout 'URI'
Example
//Set the layout's element selection.

Element rec = layoutView.Layout.FindElement("Rectangle");
Element rec2 = layoutView.Layout.FindElement("Rectangle 2");

List<Element> elmList = new List<Element>();
elmList.Add(rec);
elmList.Add(rec2);

layoutView.SelectElements(elmList);
Requirements

Target Platforms: Windows 11, Windows 10, Windows 8.1

See Also

Reference

LayoutView Class
LayoutView Members
Overload List