Unit 'Controls' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#lcl]


Converts the specified client coordinates to the screen coordinates for the specified parent control.


Source position: controls.pp line 1670

public function TControl.ClientToParent(

  const Point: TPoint;

  AParent: TWinControl = Nil





TPoint instance with the client coordinates for the control.



Parent control with the bounds for the adjusted coordinates.

Function result

TPoint instance with the client coordinates adjusted to the parent control.


ClientToParent is a TPoint function used to convert the client-relative coordinates specified in Point to the screen coordinates for the parent control in AParent. If AParent is unassigned (Nil), the Parent property for the control is used in the method.

ClientToParent calls the IsParentOf method in AParent to determine if the control is a child control for AParent. An EInvalidOperation exception is raised if the return value from IsParentOf is False.

ClientToParent calls ClientToScreen to get the absolute screen coordinates for the values in Point. The return value is the TPoint instance returned by converting the client coordinates to screen coordinates, and asking the parent control to convert the values back to client-relative coordinates for the parent control.

ClientToParent is used, for instance, in the TScrollingWinControl.ScrollInView method.

CT Web help

CodeTyphon Studio