ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / GraphicsLayerExtensions Class / SendBackward Method / SendBackward(GraphicsLayer,Element) Method
The element to send backward
Example

In This Topic
    SendBackward(GraphicsLayer,Element) Method
    In This Topic
    Send the element backward within its parent's element collection. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public static void SendBackward( 
       GraphicsLayer graphicsLayer,
       Element element
    )
    Public Overloads Shared Sub SendBackward( _
       ByVal graphicsLayer As GraphicsLayer, _
       ByVal element As Element _
    ) 

    Parameters

    graphicsLayer
    element
    The element to send backward
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Value cannot be null: element
    elements must belong to graphicsLayer
    Remarks
    Refer to CanSendBackward(GraphicsLayer,Element) to check whether an element can be sent backward. Element z order can only be changed relative to its parent's element collection. The bottom element will have a z order of 0 within the element parent's element collection. Check z order with ArcGIS.Desktop.Layouts.Element.ZOrder.
    The map view displaying the graphics layer should be initialized.
    Example
    Ordering: Send backward and Bring forward
    //On the QueuedTask
    //get the current selection set
    var sel_elems = graphicsLayer.GetSelectedElements();
    //can they be brought forward? This will also check that all elements have the same parent
    if (graphicsLayer.CanBringForward(sel_elems))
    {
      //bring forward
      graphicsLayer.BringForward(sel_elems);
      //bring to front (of parent)
      //graphicsLayer.BringToFront(sel_elems);
    }
    else if (graphicsLayer.CanSendBackward(sel_elems))
    {
      //send back
      graphicsLayer.SendBackward(sel_elems);
      //send to the back (of parent)
      //graphicsLayer.SendToBack(sel_elems);
    }
    Ordering: Send backward and Bring forward
    //On the QueuedTask
    //get the current selection set
    var sel_elems = graphicsLayer.GetSelectedElements();
    //can they be brought forward? This will also check that all elements have the same parent
    if (graphicsLayer.CanBringForward(sel_elems))
    {
      //bring forward
      graphicsLayer.BringForward(sel_elems);
      //bring to front (of parent)
      //graphicsLayer.BringToFront(sel_elems);
    }
    else if (graphicsLayer.CanSendBackward(sel_elems))
    {
      //send back
      graphicsLayer.SendBackward(sel_elems);
      //send to the back (of parent)
      //graphicsLayer.SendToBack(sel_elems);
    }
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also