DesignSurface.CreateComponent Method (Type)


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

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


Type: System.Type

The type of component to create.

Return Value

Type: System.ComponentModel.IComponent

The newly created component.

Exception Condition

componentType is null.


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