DesignSurface.CreateComponent Method (Type)

 
Note: This API is now obsolete.

Creates an instance of a component.

Namespace:   System.ComponentModel.Design
Assembly:  System.Design (in System.Design.dll)

[ObsoleteAttribute("CreateComponent has been replaced by CreateInstance and will be removed after Beta2")]
protected internal virtual IComponent CreateComponent(
	Type componentType
)

Parameters

componentType
Type: System.Type

The type of component to create.

Return Value

Type: System.ComponentModel.IComponent

The newly created component.

Exception Condition
ArgumentNullException

componentType is null.

ObjectDisposedException

The IDesignerHost attached to the DesignSurface has been disposed.

The CreateComponent method is called by the design surface’s CreateComponent method to create an instance of a component. The component should be created and added to the public container on the design surface.

.NET Framework
Available since 2.0
Return to top
Show: