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