Skip to main content
All docs
V24.2

TdxLayoutSplitterItemMovedEventArgs.FarItem Property

Provides access to the adjacent far layout item.

Declaration

property FarItem: TdxCustomLayoutItem read; write;

Property Value

Type Description
TdxCustomLayoutItem

The far layout item associated with the splitter that raised the OnClosed, OnMoved, or OnOpened event.

You can use OldFarItemBounds and NewFarItemBounds properties to identify far item dimensions after a splitter resize, expand, or collapse operation.

Remarks

Use FarItem and NearItem properties to identify and access layout items delimited by the splitter that raised the OnClosed, OnMoved, or OnOpened event.

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