RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TControl.ParentToClient Method

Translate parent coordinates to client coordinates.

Pascal
function ParentToClient(const Point: TPoint; AParent: TWinControl = nil): TPoint;
C++
__fastcall TPoint ParentToClient(const TPoint Point, TWinControl * AParent = nil);

ParentToClient translates Point from the AParent's coordinate system to the current control's coordinate system. AParent must be a control that can be found by iterating up the chain of Parent properties. If AParent is nil (Delphi) or NULL (C++), the control's immediate parent is used. 

An EInvalidOperation exception is thrown if AParent is not an ancestor control or the Parent property is nil (Delphi) or NULL (C++). 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!