WebControl.CreateControlStyle WebControl.CreateControlStyle WebControl.CreateControlStyle WebControl.CreateControlStyle Method

定義

建立樣式物件,這個物件被 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,用來實作控制項的所有樣式相關屬性。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傳回衍生自基Style底控制項所傳回之的。Note 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.

適用於

另請參閱