CreateComponent Method (Type, String)
Collapse the table of content
Expand the table of content

IDesignerHost.CreateComponent Method (Type, String)


Creates a component of the specified type and name, and adds it to the design document.

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

IComponent CreateComponent(
	Type componentClass,
	string name


Type: System.Type

The type of the component to create.

Type: System.String

The name for the component.

Return Value

Type: System.ComponentModel.IComponent

The newly created component.

If the type cannot be resolved into an object that implements IComponent, an exception is thrown.

This method creates the component and adds it to the designer container.

.NET Framework
Available since 1.1
Return to top
© 2015 Microsoft