ListControlDesigner.Initialize Method (IComponent)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Prepares the designer to view, edit, and design the associated control.

Namespace:   System.Web.UI.Design.WebControls
Assembly:  System.Design (in System.Design.dll)

public override void Initialize(
	IComponent component
)

Parameters

component
Type: System.ComponentModel.IComponent

A control derived from the ListControl that implements an IComponent.

The designer host calls the Initialize method when it is ready to use the designer to render the control that is derived from the ListControl class. The Initialize method and its base methods configure properties and connect to events that are necessary for the operation of the designer.

The component parameter is the control, derived from the ListControl, that is associated with this designer or is a copy of that control.

The following code example overrides the Initialize method in a designer derived from the ListControlDesigner class to ensure that only instances of a control class named SimpleRadioButtonList are used by the custom designer.

This code example is part of a larger example provided for the ListControlDesigner class.

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

.NET Framework
Available since 1.1
Return to top
Show: