Vcl.Controls.TWinControl.ControlAtPos

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

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

C++

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

Properties

Type Visibility Source Unit Parent
function public
Vcl.Controls.pas
Vcl.Controls.hpp
Vcl.Controls TWinControl

Description

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. 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.

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