DesignSurface.CreateComponent(Type) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
注意
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
要创建的组件的类型。
返回
新创建的组件。
- 属性
例外
componentType
为 null
。
附加到 DesignSurface 的 IDesignerHost 已被释放。
注解
方法 CreateComponent 由设计图面的 CreateComponent 方法调用,以创建组件的实例。 应创建组件并将其添加到设计图面上的公共容器。