TApplication.GetControlAtPos function
Gets the control which contains the specified position, and optionally updates the internal tracking members for mouse capture when needed.
Declaration
function GetControlAtPos(P: TPoint): TControlArguments
P | TPoint instance with the horizontal and vertical screen coordinates for a control to locate in the method. |
Function result
Control with bounds which include the specified position.
Description
GetControlAtPos is a
TControl function used to get the
control which contains the point specified in
P. The X and Y
members in P are screen coordinates.
GetControlAtPos compares the coordinates in P to existing tracking members used for the last active mouse control in the application. If the control is valid and uses the coordinates in P, it is used as the return value for the method. Otherwise, FindControlAtPos is called to locate the control at the position in P.
The return value is Nil if a control is not found for the specified position, or when called at design-time. When the return value is assigned, the internal tracking members are updated with the last active control and its position.
GetControlAtPos is used in the implementation of the GetControlAtMouse method, and in private TControl methods.
Added in LCL version 4.0.
See also
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
