In VCL, there is nothing to automatically anchor a control relative to a neighboring control. The Anchors
property is meant for aligning a control relative to the edges of its Parent
, not relative to other controls. However, windowed controls (not graphical controls) have OnAlignInsertBefore
and OnAlignPosition
events that can be used for custom alignment when the Align
property is set to alCustom
. Otherwise, you have to use OnResize
event handlers to manually position/size controls as needed.
In FireMonkey, there are TLayout
-derived components (TFlowLayout
, TGridLayout
, TScaledLayout
) to help arrange components (see Using Layouts to Arrange Components for more details), but this does not necessary equate to anchoring a control to a neighboring control, it is still relative to the Parent
, just a bit more flexible than what VCL offers.