System.Contnrs.TComponentList.Insert

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

Delphi

procedure Insert(Index: Integer; AComponent: TComponent); inline;

C++

HIDESBASE void __fastcall Insert(int Index, System::Classes::TComponent* AComponent);

プロパティ

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

説明

コンポーネントをリストの指定位置に追加します。

Insert を呼び出すと,リストの指定位置にコンポーネントを追加できます。コンポーネントの追加前にその位置にあった項目(およびそれ以降のすべての項目)は,順送りにされます。Insert メソッドは,Count プロパティをインクリメントし,必要な場合は Capacity プロパティの値を増やしてメモリを割り当てます。

Index パラメータはゼロベースなので,リスト内の最初の位置には 0 のインデックスが付けられます。

配列の大きさを変えずに,nil(Delphi)または NULL(C++)参照を新しいコンポーネントに置き換えるには,Items プロパティを直接設定してください。

関連項目