From RAD Studio API Documentation
Jump to: navigation, search


typedef void __fastcall (__closure *TAlignPositionEvent)(TWinControl* Sender, TControl* Control, int &NewLeft, int &NewTop, int &NewWidth, int &NewHeight, System::Types::TRect &AlignRect, const TAlignInfo &AlignInfo);


Type Visibility Source Unit Parent
typedef public Vcl.Controls.hpp Vcl.Controls Vcl.Controls


TAlignPositionEvent is the function type for an OnAlignPosition event.

CustomAlignPosition triggers the OnAlignPosition event. OnAlignPosition occurs for each child control with an Align property of alCustom when it is aligned. It can determine where the control is placed by specifying the alignment parameters.

TAlignPositionEvent has the following parameters:

Parameter Meaning


Parent control.

NewLeft | NewTop | NewWidth | NewHeight

Location and size of child control, as determined by container's size and the Anchors TControl_Anchors constraints for the control. OnAlignPosition can modify these values to reposition the control.


The client area in which the control is aligned. OnAlignPosition can modify this value.


Alignment information in a TAlignInfo.

See Also