RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
Forms.ValidParentForm Function

Returns the form or property page that contains a specified control.

Pascal
function ValidParentForm(Control: TControl; TopForm: Boolean = True): TCustomForm;
C++
TCustomForm ValidParentForm(TControl * Control, Boolean TopForm = True);

Call ValidParentForm to obtain the descendant of TCustomForm that contains the control specified by the Control parameter. If the TopForm parameter if true, this function goes all the way up the parent chain for Control until it finds a Form with no parent. If TopForm if false, this function goes up the parent chain until it finds a Form that is a TCustomForm

If the control is not contained in a form (for example, an ActiveX control embedded in another type of window), ValidParentForm raises an EInvalidOperation exception. 

 

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