ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Layouts Namespace / Element Class / SetTOCPositionRelative Method / SetTOCPositionRelative(Element,Boolean) Method
An existing Element in the layout TOC.
Set to true to place the target above the reference element

In This Topic
    SetTOCPositionRelative(Element,Boolean) Method
    In This Topic
    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 Overloads Sub SetTOCPositionRelative( _
       ByVal targetElement As Element, _
       ByVal isAbove As Boolean _
    ) 
    public void SetTOCPositionRelative( 
       Element targetElement,
       bool isAbove
    )

    Parameters

    targetElement
    An existing Element in the layout TOC.
    isAbove
    Set to true to place the target above the reference element
    Exceptions
    ExceptionDescription
    This method must be called within the lambda passed to QueuedTask.Run.
    Remarks
    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.
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also