ListControlDesigner.Initialize(IComponent) メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
関連するコントロールを表示、編集、デザインするためのデザイナーを準備します。
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から派生したコントロールで、このデザイナーに関連付けられているか、そのコントロールのコピーです。