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

説明

コンポーネントをリストの末尾に挿入します。

Add を呼び出すと,リストの末尾にコンポーネントを挿入できます。Add は,配列に nil(Delphi)または NULL(C++)参照が入っていても,最終項目の後ろにコンポーネントを配置し,挿入したコンポーネントのインデックスを返します(リストの先頭コンポーネントのインデックスは 0)。

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

関連項目