共用方式為


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 方法來呼叫,以建立元件的實例。 元件應該建立並新增至設計介面上的公用容器。

適用於