System.Classes.TComponent.GetParentComponent
Delphi
function GetParentComponent: TComponent; dynamic;
C++
DYNAMIC TComponent* __fastcall GetParentComponent(void);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.Classes.pas System.Classes.hpp |
System.Classes | TComponent |
Description
Returns the containing component.
GetParentComponent returns a reference to the component that contains the current component, or nil if there is no container. Use HasParent to determine whether a component has a containing component.
For example, a button on a panel on a form returns the panel, the panel returns the form, and the form returns nil.