[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] |
Converts absolute screen coordinates into client-relative coordinates.
Source position: controls.pp line 1741
public function TControl.ScreenToClient( |
const APoint: TPoint |
):TPoint; virtual; |
APoint |
|
TPoint instance with the screen coordinates converted in the method. |
TPoint instance with the client-relative coordinates for the specified screen coordinates.
The APoint argument contains the screen coordinates which are converted to client-relative coordinates in the method. The X member has the horizontal coordinate, and the Y member has the vertical coordinate.
The return value is a TPoint type which contains the coordinates from APoint with the X and Y members decremented by the corresponding values found in the ClientOrigin for the control.
Remark: | Accessing the ClientOrigin property raises an EInvalidOperation exception if Parent has not been assigned for the control. |
ScreenToClient is used in the implementation of methods like ClientToParent, ParentToClient, and GetMousePosFromMessage. It is also used to convert mouse coordinates during drag and drop, docking, and context menu operations.
Use ScreenToControl to convert absolute screen coordinate to control-relative values.
Use ClientToScreen to convert client-relative coordinates to absolute screen coordinates. Use ControlToScreen to convert the coordinates in the control to absolute screen coordinates.
|
The control within which the control is shown. |
|
|
Screen coordinates of the Top, Left pixel (in the client area) of the control. |
|
|
Converts absolute screen coordinates to control-relative coordinates. |
|
|
Converts client-relative coordinates to absolute screen coordinates. |
|
|
Converts control-relative coordinates to absolute screen coordinates. |
|
Version 3.2 | Generated 2024-02-25 | Home |