From RAD Studio API Documentation
Jump to: navigation, search


function ControlAtPos(const Pos: TPoint; AllowDisabled: Boolean;
AllowWinControls: Boolean = False; AllLevels: Boolean = False): TControl;


TControl* __fastcall ControlAtPos(const System::Types::TPoint &Pos, bool AllowDisabled, bool AllowWinControls = false, bool AllLevels = false);


Type Visibility Source Unit Parent
function public
Vcl.Controls TWinControl


Returns the child control located at a specified position within the control.

Use ControlAtPos to determine which child control is at the specified location within the control.

When AllLevels is False, then ControlAtPos returns an immediate child of the control; that is, one of the entries of the Controls property that has this control for its Parent property. When AllLevels is True, then a child from any nested level.

Specify the position in client coordinates as the value of the Pos parameter. Pos can be anywhere within the boundaries of the child control, not just the upper left corner.

The AllowDisabled parameter determines whether the search for controls includes disabled controls.

The AllowWinControls parameter determines whether descendants of TWinControl are considered when looking for the child control.

If there is no control that matches the AllowDisabled and AllowWinControls parameters at the specified position, ControlAtPos returns nil (Delphi) or NULL (C++).

See Also