다음을 통해 공유


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에서 파생되는 컨트롤입니다.

예제

다음 코드 예제에서는 명명 된 컨트롤 클래스 SimpleRadioButtonList 의 인스턴스만 사용자 지정 디자이너에서 사용 되도록 클래스에서 ListControlDesigner 파생 된 디자이너의 메서드를 재정 Initialize 의 합니다.

이 코드 예제는에 대해 제공 된 큰 예제의 일부는 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

설명

디자이너 호스트는 클래스에서 파생된 컨트롤을 렌더링하는 데 디자이너를 사용할 준비가 되면 메서드를 ListControl 호출 Initialize 합니다. 메서드와 해당 기본 메서드는 Initialize 속성을 구성하고 디자이너 작업에 필요한 이벤트에 연결합니다.

매개 변수는 component 이 디자이너와 연결되었거나 해당 컨트롤의 복사본인 컨트롤에서 ListControl파생됩니다.

적용 대상

추가 정보