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

附加到 DesignSurfaceIDesignerHost 已被释放。

注解

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

适用于