Forms.ValidParentForm

From RAD Studio VCL Reference
Jump to: navigation, search

Contents

Delphi Information

From Forms.pas

	function ValidParentForm(Control: TControl; TopForm: Boolean = True): TCustomForm;


Unit: Forms

Type: function

Visibility: public

C++ Information

From Forms.hpp

	Forms::TCustomForm * __fastcall ValidParentForm(Controls::TControl * Control, bool TopForm);


Unit: Forms

Type: function

Description

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


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.

See Also

Personal tools
Translations
Newest Version