System.Classes.TComponent.SetSubComponent

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure SetSubComponent(IsSubComponent: Boolean);

C++

void __fastcall SetSubComponent(bool IsSubComponent);

Properties

Type Visibility Source Unit Parent
procedure
function
public
System.Classes.pas
System.Classes.hpp
System.Classes TComponent

Description

Identifies whether the component is a subcomponent.

Call SetSubComponent to indicate whether this component is a subcomponent. A subcomponent is a component whose Owner is a component other than the form or data module in which it resides. Unless such a component calls SetSubComponent with IsSubComponent set to True, its published properties will not be saved to the form file.

IsSubComponent indicates whether the component is a subcomponent (True) or not (False).

SetSubComponent is called at design time:

  • Either from the constructor of a component that always acts as a subcomponent. In this case, the component calls its own SetSubComponent method from the constructor with IsSubComponent set to True.
  • Or immediately after constructing an instance of the subcomponent. In this case, the Owner calls the SetSubComponent method of a component it has just instantiated, with IsSubComponent set to True.

See Also