System.Classes.TComponent.InsertComponent

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

Delphi

procedure InsertComponent(const AComponent: TComponent);

C++

void __fastcall InsertComponent(TComponent* const AComponent);

プロパティ

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

説明

コンポーネントを指定したコンポーネントのオーナーにします。

InsertComponent メソッドは,AComponent パラメータで渡されたコンポーネントを Components 配列プロパティの最後に追加します。挿入したコンポーネントには名前を付けないでください(Name プロパティに値を指定してはなりません)。名前を付ける場合は Components リストのそれ以外のすべてのコンポーネントと重複しない名前を付ける必要があります。

オーナーのコンポーネントを破棄すると,AComponent も破棄されます。

フォームデザイナでコンポーネントを視覚的に操作すると,コンポーネントが自動的に挿入または削除されます。InsertComponent は,コンポーネントを別の Owner のコンポーネントの Components リストに手動で追加するときに使用します。

関連項目