Skip to main content
All docs
V25.1
  • TdxLayoutSplitterItemMovedEventArgs.NewFarItemBounds Property

    Returns far item boundaries (in pixels) after the current splitter expand, collapse, or move operation.

    Declaration

    property NewFarItemBounds: TRect read;

    Property Value

    Type Description
    TRect

    The bounding rectangle of the far item after the current splitter expand, collapse, or move operation.

    Remarks

    Use NewNearItemBounds and NewFarItemBounds properties to obtain delimited item boundaries after a splitter movement operation.

    Near, Far, and Target Layout Items

    Near and far item positions depend on the parent layout group‘s LayoutDirection property value:

    ldVertical
    Default. The group arranges items from top to bottom. The near item is above the splitter, and the far item is below it.
    ldHorizontal
    The group arranges items from left to right. Near and far items are to the left and right of a splitter, respectively.

    The target item is the near or far layout item associated with the splitter, depending on AlignVert and AlignHorz property values as well as the parent group direction.

    For example, the near item is the splitter target if the parent group is horizontally arranged, and the AlignHorz property is set to ahLeft:

    VCL Layout Control: A Splitter and Delimited Layout Groups

    Code Example: Track Splitter Movement

    The following code example demonstrates an OnMoved event handler that displays names and sizes of layout items delimited by the currently dragged splitter in a horizontally arranged layout group:

    procedure TMyForm.dxLayoutSplitterItem1Moved(
      Sender: TdxLayoutSplitterItem; AArgs: TdxLayoutSplitterItemMovedEventArgs);
    begin
      Caption := AArgs.NearItem.Name + ' Item Width: ' + IntToStr(AArgs.NewNearItemBounds.Width) + ' ' +
        AArgs.FarItem.Name + ' Item Width: ' + IntToStr(AArgs.NewFarItemBounds.Width);
    end;
    
    See Also