ArcGIS Pro 2.4 API Reference Guide
SetTOCPositionRelative Method
Example 

ArcGIS.Desktop.Layouts Namespace > Element Class : SetTOCPositionRelative Method
An existing element in the layout TOC.
Boolean
Sets the position of an element either above or below a reference element. This method must be called on the MCT. Use QueuedTask.Run.
Syntax
Public Sub SetTOCPositionRelative( _
   ByVal referenceElement As Element, _
   ByVal isAbove As Boolean _
) 
public void SetTOCPositionRelative( 
   Element referenceElement,
   bool isAbove
)

Parameters

referenceElement
An existing element in the layout TOC.
isAbove
Boolean
Exceptions
ExceptionDescription
This method must be called within the lambda passed to QueuedTask.Run.
Remarks
If set to true, the element is placed above the reference element. The reference element can either be at the root level of the layout TOC or an element in a group element. Elements can be easily moved into or out of groups.
Example
//Move a layout element above an existing layout element.

//Perform on the worker thread
await QueuedTask.Run(() =>
{
  element.SetTOCPositionRelative(element, true);
});
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 7

See Also

Reference

Element Class
Element Members