API:System.Contnrs.TComponentList.Add

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function Add(AComponent: TComponent): NativeInt; inline;

C++

HIDESBASE System::NativeInt __fastcall Add(System::Classes::TComponent* AComponent);

Properties

Type Visibility Source Unit Parent
function public
System.Contnrs.pas
System.Contnrs.hpp
System.Contnrs TComponentList

Description

Inserts an object at the end of the list.

System.Contnrs.TComponentList.Add inherits from System.Contnrs.TObjectList.Add. All content below this line refers to System.Contnrs.TObjectList.Add.

Inserts an object at the end of the list.

Call Add to insert an object at the end of the list. Add places the object after the last item, even if the array contains nil (Delphi) or NULL (C++) references, and returns the index of the inserted object. (The first object in the list has an index of 0.)

Add increments Count and, if necessary, allocates memory by increasing the value of Capacity.

See Also