Controls.TWinControl.ControlAtPos

From RAD Studio VCL Reference
Jump to: navigation, search

Contents

Delphi Information

From Controls.pas

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


Unit: Controls

Type: method

Visibility: public

Member Of: TWinControl

C++ Information

From Controls.hpp

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


Unit: Controls

Type: method

Visibility: public

Member Of: 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

Personal tools
Translations
Newest Version