DesignSurface::CreateComponent Method (Type^)
.NET Framework (current version)
Note: This API is now obsolete.
Namespace:
System.ComponentModel.Design
Assembly: System.Design (in System.Design.dll)
Return to top
Creates an instance of a component.
Assembly: System.Design (in System.Design.dll)
public protected: [ObsoleteAttribute("CreateComponent has been replaced by CreateInstance and will be removed after Beta2")] 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
Available since 2.0
Available since 2.0
Show: