API:System.Contnrs.TComponentList.Add

提供: RAD Studio API Documentation
移動先: 案内検索

Delphi

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

C++

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

プロパティ

種類 可視性 ソース ユニット
function public
System.Contnrs.pas
System.Contnrs.hpp
System.Contnrs TComponentList

説明

リストの最後にオブジェクトを挿入します。

System.Contnrs.TComponentList.Add は System.Contnrs.TObjectList.Add を継承しています。以下の内容はすべて System.Contnrs.TObjectList.Add を参照しています。

リストの最後にオブジェクトを挿入します。

Add メソッドを呼び出すと,リストの最後にオブジェクトを挿入できます。Add メソッドは,配列に nil 参照(Delphi)または NULL 参照(C++)が含まれている場合でも,最後の項目の後にオブジェクトを挿入し,挿入したオブジェクトのインデックスを返します。(リスト内で最初のオブジェクトのインデックスは 0)。

Add メソッドは,Count プロパティをインクリメントし,必要な場合は Capacity プロパティの値を増やしてメモリを割り当てます。

関連項目