This topic has not yet been rated - Rate this topic

DesignSurface.CreateComponent Method

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

Obsolete (compiler warning) in 4
Obsolete (compiler warning) in 3.5
Obsolete (compiler warning) in 3.5 SP1
Obsolete (compiler warning) in 3.0
Obsolete (compiler warning) in 3.0 SP1
Obsolete (compiler warning) in 3.0 SP2
Obsolete (compiler warning) in 2.0
Obsolete (compiler warning) in 2.0 SP1
Obsolete (compiler warning) in 2.0 SP2

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ