DesignSurface.CreateComponent Method
.NET Framework 4
Note: This API is now obsolete.
Creates an instance of a component.
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.
| 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 4Obsolete (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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
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.