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")>]
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。
備註
CreateComponent此方法是設計表面CreateComponent的方法來建立元件實例。 元件應建立並加入設計表面的公共容器。