WebControl.CreateControlStyle 方法

定義

建立樣式物件,這個物件被 WebControl 類別內部使用,以實作所有的樣式相關屬性。Creates the style object that is used internally by the WebControl class to implement all style related properties. 這個方法主要由控制項開發人員使用。This method is used primarily by control developers.

protected:
 virtual System::Web::UI::WebControls::Style ^ CreateControlStyle();
protected virtual System.Web.UI.WebControls.Style CreateControlStyle ();
abstract member CreateControlStyle : unit -> System.Web.UI.WebControls.Style
override this.CreateControlStyle : unit -> System.Web.UI.WebControls.Style
Protected Overridable Function CreateControlStyle () As Style

傳回

Style

Style 是用來實作控制項所有樣式相關的屬性。A Style that is used to implement all style-related properties of the control.

備註

CreateControlStyle方法是用來建立在內部用來執行所有樣式相關屬性的樣式物件。The CreateControlStyle method is used to create the style object that is used internally to implement all style related properties. 衍生類別可以覆寫這個方法,以建立適合類別的樣式。Derived classes can override this method to create a style that is appropriate to the class. 這個方法主要由控制項開發人員使用。This method is primarily used by control developers.

注意 控制項開發人員應傳回 Style 衍生自基底控制項所傳回之的 StyleNote Control developers should return a Style that derives from the Style that the base control returns. ControlStyle因為衍生的控制項可能會傳回不同的類型,所以無法假設為特定樣式類型。It cannot be assumed that the ControlStyle is of a particular Style type since a derived control may return a different type.

適用於

另請參閱