property SwimLane.LayoutChangingObject as Variant
Returns the object (element, link, pool, lane or phase) being changed during the LayoutStartChanging and LayoutEndChanging events.

TypeDescription
Variant A VARIANT expression that specifies the object (Element, Link, Pool, Lane, or Phase) being moved or resized during the LayoutStartChanging or LayoutEndChanging events. Returns an empty or null value outside these events.

The following table provides a summary of the possible object types that can be returned by the LayoutChangingObject property:

  • Element, represents a swimlane element being moved or resized (exMoveElement or exResizeElement)
  • Link, represents a swimlane link being moved or resized (exFocusLink)
  • Pool, represents a swimlane pool being moved or resized (exMovePool, exResizePool or exResizePoolHeader)
  • Lane, represents a swimlane lane/phase being moved or resized (exMoveLane or exResizeLane)
Shortly, the LayoutChangingObject property provides a way to identify the specific object that is being manipulated during the layout change events, allowing for more granular control and customization of the swimlane layout behavior.
By default, the LayoutChangingObject property returns a null or empty value when accessed outside of the LayoutStartChanging and LayoutEndChanging events. However, during these events, it provides a reference to the object that is currently being moved or resized, enabling developers to implement custom logic based on the specific object type and its properties.

The following VB sample demonstrates how to use the LayoutChangingObject property within the LayoutStartChanging event to identify and respond to the object being manipulated:

Private Sub SwimLane1_LayoutStartChanging(ByVal Operation As EXSWIMLANELibCtl.LayoutChangingEnum)
    With SwimLane1
        If Not IsEmpty(.LayoutChangingObject) Then
            Debug.Print "Start " & Operation & " " & TypeName(.LayoutChangingObject)
        End If
    End With
End Sub

The following VB sample demonstrates how to use the LayoutChangingObject property within the LayoutEndChanging event to change the background color of an element being moved:

Private Sub SwimLane1_LayoutEndChanging(ByVal Operation As EXSWIMLANELibCtl.LayoutChangingEnum)
    With SwimLane1
        If Not IsEmpty(.LayoutChangingObject) Then
            If (Operation = exResizeElement) Then
                .LayoutChangingObject.BackColor = vbRed
            End If
        End If
    End With
End Sub
The following VB sample demonstrates how to use the LayoutChangingObject property within the LayoutEndChanging event to change the background color of a lane being moved or resized:
  Private Sub SwimLane1_LayoutEndChanging(ByVal Operation As EXSWIMLANELibCtl.LayoutChangingEnum)
    With SwimLane1
        If TypeOf .LayoutChangingObject Is EXSWIMLANELibCtl.ILane Then
            .LayoutChangingObject.Color = vbRed
        End If
    End With
End Sub

The following C# sample demonstrates how to use the LayoutChangingObject property within the LayoutEndChanging event to change the background color of an element being moved or resized:

private void exswimlane1_LayoutEndChanging(object sender, exontrol.EXSWIMLANELib.LayoutChangingEnum Operation)
{
    if (exswimlane1.LayoutChangingObject != null)
    {
        if (exswimlane1.LayoutChangingObject.GetType() == typeof(exontrol.EXSWIMLANELib.Element))
        {
            exontrol.EXSWIMLANELib.Element e = (exontrol.EXSWIMLANELib.Element)exswimlane1.LayoutChangingObject;
            e.BackColor = Color.Red;
        }
    }
}

The following VB.NET sample demonstrates how to use the LayoutChangingObject property within the LayoutEndChanging event to change the background color of an element being moved or resized:

Private Sub Exswimlane1_LayoutEndChanging(ByVal sender As Object, ByVal Operation As exontrol.EXSWIMLANELib.LayoutChangingEnum) Handles Exswimlane1.LayoutEndChanging
    If TypeOf Exswimlane1.LayoutChangingObject Is exontrol.EXSWIMLANELib.Element Then
        Dim element As exontrol.EXSWIMLANELib.Element = CType(Exswimlane1.LayoutChangingObject, exontrol.EXSWIMLANELib.Element)
        element.BackColor = Color.Red
    End If
End Sub