DesignSurface.CreateComponent(Type) 方法

定义

注意

CreateComponent has been replaced by CreateInstance and will be removed after Beta2

创建组件的实例。

protected public:
 virtual System::ComponentModel::IComponent ^ CreateComponent(Type ^ componentType);
[System.Obsolete("CreateComponent has been replaced by CreateInstance and will be removed after Beta2")]
protected internal virtual System.ComponentModel.IComponent CreateComponent(Type componentType);
[System.Obsolete("CreateComponent has been replaced by CreateInstance and will be removed after Beta2")]
protected internal virtual System.ComponentModel.IComponent? CreateComponent(Type componentType);
[<System.Obsolete("CreateComponent has been replaced by CreateInstance and will be removed after Beta2")>]
abstract member CreateComponent : Type -> System.ComponentModel.IComponent
override this.CreateComponent : Type -> System.ComponentModel.IComponent
Protected Friend Overridable Function CreateComponent (componentType As Type) As IComponent

参数

componentType
Type

要创建的组件的类型。

返回

新建的组件。

属性

例外

componentTypenull

IDesignerHost已释放附加到该DesignSurface对象。

注解

该方法 CreateComponent 由设计图面 CreateComponent 的方法调用,以创建组件的实例。 组件应创建并添加到设计图面上的公共容器。

适用于