[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Controls' (#lcl)

# TControl.ParentToClient

Converts the specified client coordinates on a parent control to the client coordinates for the control instance.

## Declaration

Source position: controls.pp line 1739

`public function TControl.ParentToClient(`
`const Point: TPoint;`
`AParent: TWinControl = Nil`
`):TPoint;`

## Arguments

`Point` |  | TPoint instance with the coordinates examined and adjusted in the method.
`AParent` |  | Parent control with the origin used to adjust the client coordinates.

## Function result

TPoint instance with the client coordinates relative the client origin in a parent control.

## Description

Point contains the client coordinates relative the parent control AParent. If AParent is not assigned (Nil), the value in the Parent property is used as the value for the argument.

ParentToClient calls the IsParentOf method in AParent to determine if the current control is hosted on AParent. An EInvalidOperation exception is raised if the IsParentOf method returns False.

The return value is a TPoint instance with client coordinates for the control relative to the client coordinates on AParent.