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.

 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.