ListControlDesigner.Initialize(IComponent) メソッド

定義

関連するコントロールを表示、編集、デザインするためのデザイナーを準備します。

public:
 override void Initialize(System::ComponentModel::IComponent ^ component);
public override void Initialize(System.ComponentModel.IComponent component);
override this.Initialize : System.ComponentModel.IComponent -> unit
Public Overrides Sub Initialize (component As IComponent)

パラメーター

component
IComponent

ListControlを実装するIComponentから派生したコントロール。

次のコード例では、Initialize クラスから派生したデザイナーのListControlDesigner メソッドをオーバーライドして、SimpleRadioButtonListという名前のコントロール クラスのインスタンスのみがカスタム デザイナーによって使用されるようにします。

このコード例は、 ListControlDesigner クラスに提供されるより大きな例の一部です。

public override void Initialize(IComponent component)
{
    // Ensure that only a SimpleRadioButtonList can be 
    // created in this designer.
    Debug.Assert( 
        component is SimpleRadioButtonList, 
        "An invalid SimpleRadioButtonList control was initialized.");

    simpleRadioButtonList = (SimpleRadioButtonList)component;
    base.Initialize(component);
} // Initialize
Public Overrides Sub Initialize(ByVal component As IComponent)

    ' Ensure that only a SimpleRadioButtonList can be created 
    ' in this designer.
    Debug.Assert( _
        TypeOf component Is SimpleRadioButtonList, _
        "An invalid SimpleRadioButtonList control was initialized.")

    simpleRadioButtonList = CType(component, SimpleRadioButtonList)
    MyBase.Initialize(component)
End Sub

注釈

デザイナー ホストは、デザイナーを使用して、Initialize クラスから派生したコントロールをレンダリングする準備ができたら、ListControl メソッドを呼び出します。 Initialize メソッドとその基本メソッドは、プロパティを構成し、デザイナーの操作に必要なイベントに接続します。

component パラメーターは、ListControlから派生したコントロールで、このデザイナーに関連付けられているか、そのコントロールのコピーです。

適用対象

こちらもご覧ください