TitleStyle 类
定义
指定区域中 Web 部件控件的标题栏的样式特性。Specifies the style characteristics for the title bars of Web Parts controls within a zone.
public ref class TitleStyle sealed : System::Web::UI::WebControls::TableItemStyle
public sealed class TitleStyle : System.Web.UI.WebControls.TableItemStyle
type TitleStyle = class
inherit TableItemStyle
Public NotInheritable Class TitleStyle
Inherits TableItemStyle
- 继承
示例
下面的代码示例演示类的声明性用法 TitleStyle 。The following code example demonstrates the declarative use of the TitleStyle class. 在以下页面的代码中, <asp:calendar> 元素和 <asp:label> 元素显示在区域内,使相应的控件在运行时具有正版 Web 部件功能。In the code for the following page, an <asp:calendar> element and an <asp:label> element appear within a zone, giving the corresponding controls genuine Web Parts functionality at run time. 请注意, <parttitlestyle> 包含多个样式属性的元素将应用到该区域中包含的两个 Web 部件控件的标题栏。Notice that the <parttitlestyle> element, which contains several style attributes, applies to the title bars of both Web Parts controls contained within the zone.
<%@ page Language="c#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>ASP.NET Example</title>
</head>
<body>
<form id="Form1" runat="server">
<asp:webpartmanager id="WebPartManager1" runat="server" />
<asp:webpartzone
id="WebPartZone1"
runat="server"
title="Zone 1">
<parttitlestyle
font-bold="true"
BorderWidth="2"
ForeColor="#3300cc" />
<partstyle
borderwidth="1px"
borderstyle="Solid"
bordercolor="#81AAF2" />
<zonetemplate>
<asp:calendar
ID="cal1"
Runat="server"
Title="My Calendar" />
<asp:Label id="label1" runat="server"
Title="A WebPart Label">
The label control acts as a WebPart.
</asp:Label>
</zonetemplate>
</asp:webpartzone>
</form>
</body>
</html>
<%@ page Language="vb" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>ASP.NET Example</title>
</head>
<body>
<form id="Form1" runat="server">
<asp:webpartmanager id="WebPartManager1" runat="server" />
<asp:webpartzone
id="WebPartZone1"
runat="server"
title="Zone 1">
<parttitlestyle
font-bold="true"
BorderWidth="2"
ForeColor="#3300cc" />
<partstyle
borderwidth="1px"
borderstyle="Solid"
bordercolor="#81AAF2" />
<zonetemplate>
<asp:calendar
ID="cal1"
Runat="server"
Title="My Calendar" />
<asp:Label id="label1" runat="server"
Title="A WebPart Label">
The label control acts as a WebPart.
</asp:Label>
</zonetemplate>
</asp:webpartzone>
</form>
</body>
</html>
注解
TitleStyle类与区域一起用于指定适用于区域中 Web 部件控件标题栏的通用样式特征。The TitleStyle class is used with zones to specify common style characteristics that apply to the title bars of Web Parts controls within the zones. PartTitleStyle属性包含对 TitleStyle 每个区域的对象的引用。The PartTitleStyle property contains a reference to a TitleStyle object for each zone.
控件的标题栏在运行时呈现为 HTML 表单元格。A title bar for a control is rendered at run time as an HTML table cell. 由于 TitleStyle 类从 TableItemStyle 类继承,因此它允许您为标题栏设置类似于任何表格单元的属性的样式属性。Because the TitleStyle class inherits from the TableItemStyle class, it allows you to set stylistic attributes for a title bar similar to the attributes for any table cell.
构造函数
| TitleStyle() |
初始化 TitleStyle 类的新实例。Initializes a new instance of the TitleStyle class. |
属性
| BackColor |
获取或设置 Web 服务器控件的背景色。Gets or sets the background color of the Web server control. (继承自 Style) |
| BorderColor |
获取或设置 Web 服务器控件的边框颜色。Gets or sets the border color of the Web server control. (继承自 Style) |
| BorderStyle |
获取或设置 Web 服务器控件的边框样式。Gets or sets the border style of the Web server control. (继承自 Style) |
| BorderWidth |
获取或设置 Web 服务器控件的边框宽度。Gets or sets the border width of the Web server control. (继承自 Style) |
| CanRaiseEvents |
获取一个指示组件是否可以引发事件的值。Gets a value indicating whether the component can raise an event. (继承自 Component) |
| Container |
获取包含 IContainer 的 Component。Gets the IContainer that contains the Component. (继承自 Component) |
| CssClass |
获取或设置由 Web 服务器控件在客户端呈现的级联样式表 (CSS) 类。Gets or sets the cascading style sheet (CSS) class rendered by the Web server control on the client. (继承自 Style) |
| DesignMode |
获取一个值,用以指示 Component 当前是否处于设计模式。Gets a value that indicates whether the Component is currently in design mode. (继承自 Component) |
| Events |
获取附加到此 Component 的事件处理程序的列表。Gets the list of event handlers that are attached to this Component. (继承自 Component) |
| Font |
获取与 Web 服务器控件关联的字体属性。Gets the font properties associated with the Web server control. (继承自 Style) |
| ForeColor |
获取或设置 Web 服务器控件的前景色(通常是文本颜色)。Gets or sets the foreground color (typically the color of the text) of the Web server control. (继承自 Style) |
| Height |
获取或设置 Web 服务器控件的高度。Gets or sets the height of the Web server control. (继承自 Style) |
| HorizontalAlign |
获取或设置单元格内容的水平对齐方式。Gets or sets the horizontal alignment of the contents in a cell. (继承自 TableItemStyle) |
| IsEmpty |
保护属性。A protected property. 获取一个值,该值指示是否已在状态袋中定义任何样式元素。Gets a value indicating whether any style elements have been defined in the state bag. (继承自 Style) |
| IsTrackingViewState |
返回一个值,该值指示状态袋中是否有任何已定义的样式元素。Returns a value indicating whether any style elements have been defined in the state bag. (继承自 Style) |
| RegisteredCssClass |
获取已向控件注册的级联样式表 (CSS) 类。Gets the cascading style sheet (CSS) class that is registered with the control. (继承自 Style) |
| Site |
获取或设置 Component 的 ISite。Gets or sets the ISite of the Component. (继承自 Component) |
| VerticalAlign |
获取或设置单元格内容的垂直对齐方式。Gets or sets the vertical alignment of the contents in a cell. (继承自 TableItemStyle) |
| ViewState |
获取保存样式元素的状态袋。Gets the state bag that holds the style elements. (继承自 Style) |
| Width |
获取或设置 Web 服务器控件的宽度。Gets or sets the width of the Web server control. (继承自 Style) |
| Wrap |
获取或设置一个值,该值指示部件控件标题的内容是否在标题栏中换行。Gets or sets a value indicating whether the contents of the title bar for a part control wrap in the title bar. |
方法
| AddAttributesToRender(HtmlTextWriter) |
将需要呈现的 HTML 特性和样式添加到指定的 HtmlTextWriter 中。Adds HTML attributes and styles that need to be rendered to the specified HtmlTextWriter. 此方法主要由控件开发人员使用。This method is primarily used by control developers. (继承自 Style) |
| AddAttributesToRender(HtmlTextWriter, WebControl) |
将有关水平对齐方式、垂直对齐方式和包装的信息添加到要呈现的特性列表中。Adds information about horizontal alignment, vertical alignment, and wrap to the list of attributes to render. (继承自 TableItemStyle) |
| CopyFrom(Style) |
将指定 Style 的非空样式属性复制到从中调用此方法的 TableItemStyle 类的实例中。Duplicates the non-empty style properties of the specified Style into the instance of the TableItemStyle class that this method is called from. (继承自 TableItemStyle) |
| CreateObjRef(Type) |
创建一个对象,该对象包含生成用于与远程对象进行通信的代理所需的全部相关信息。Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (继承自 MarshalByRefObject) |
| Dispose() |
释放由 Component 使用的所有资源。Releases all resources used by the Component. (继承自 Component) |
| Dispose(Boolean) |
释放由 Component 占用的非托管资源,还可以另外再释放托管资源。Releases the unmanaged resources used by the Component and optionally releases the managed resources. (继承自 Component) |
| Equals(Object) |
确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object. (继承自 Object) |
| FillStyleAttributes(CssStyleCollection, IUrlResolutionService) |
将指定对象的样式属性添加到 CssStyleCollection 对象。Adds the specified object's style properties to a CssStyleCollection object. (继承自 Style) |
| GetHashCode() |
作为默认哈希函数。Serves as the default hash function. (继承自 Object) |
| GetLifetimeService() |
已过时。
检索控制此实例的生存期策略的当前生存期服务对象。Retrieves the current lifetime service object that controls the lifetime policy for this instance. (继承自 MarshalByRefObject) |
| GetService(Type) |
返回一个对象,该对象表示由 Component 或它的 Container 提供的服务。Returns an object that represents a service provided by the Component or by its Container. (继承自 Component) |
| GetStyleAttributes(IUrlResolutionService) |
检索实现了 CssStyleCollection 的指定对象的 IUrlResolutionService 对象。Retrieves the CssStyleCollection object for the specified IUrlResolutionService-implemented object. (继承自 Style) |
| GetType() |
获取当前实例的 Type。Gets the Type of the current instance. (继承自 Object) |
| InitializeLifetimeService() |
已过时。
获取生存期服务对象来控制此实例的生存期策略。Obtains a lifetime service object to control the lifetime policy for this instance. (继承自 MarshalByRefObject) |
| LoadViewState(Object) |
加载以前保存的状态。Loads the previously saved state. (继承自 Style) |
| MemberwiseClone() |
创建当前 Object 的浅表副本。Creates a shallow copy of the current Object. (继承自 Object) |
| MemberwiseClone(Boolean) |
创建当前 MarshalByRefObject 对象的浅表副本。Creates a shallow copy of the current MarshalByRefObject object. (继承自 MarshalByRefObject) |
| MergeWith(Style) |
将指定 Style 的样式属性与从中调用此方法的 TableItemStyle 类的实例组合。Combines the style properties of the specified Style into the instance of the TableItemStyle class that this method is called from. (继承自 TableItemStyle) |
| Reset() |
从样式中移除任何已定义的样式元素。Removes any defined style elements from the style. (继承自 TableItemStyle) |
| SaveViewState() |
受保护的方法。A protected method. 保存在调用 TrackViewState() 方法后已修改的任何状态。Saves any state that has been modified after the TrackViewState() method was invoked. (继承自 Style) |
| SetBit(Int32) |
受保护的内部方法。A protected internal method. 设置一个内部位屏蔽字段以指示存储在状态袋中的样式属性。Sets an internal bitmask field that indicates the style properties that are stored in the state bag. (继承自 Style) |
| SetDirty() |
标记 Style 以便在视图状态中记录其状态。Marks the Style so that its state will be recorded in view state. (继承自 Style) |
| ToString() |
返回表示当前对象的字符串。Returns a string that represents the current object. (继承自 Style) |
| TrackViewState() |
受保护的方法。A protected method. 标记跟踪控件状态更改的起始点。Marks the beginning for tracking state changes on the control. 跟踪开始之后所做的任何更改都将被跟踪并保存到控件视图状态中。Any changes made after tracking has begun will be tracked and saved as part of the control view state. (继承自 Style) |
事件
| Disposed |
在通过调用 Dispose() 方法释放组件时发生。Occurs when the component is disposed by a call to the Dispose() method. (继承自 Component) |
显式接口实现
| IStateManager.IsTrackingViewState |
获取一个值,该值指示服务器控件是否在跟踪其视图状态更改。Gets a value that indicates whether a server control is tracking its view state changes. (继承自 Style) |
| IStateManager.LoadViewState(Object) |
加载以前保存的状态。Loads the previously saved state. (继承自 Style) |
| IStateManager.SaveViewState() |
返回包含状态更改的对象。Returns the object containing state changes. (继承自 Style) |
| IStateManager.TrackViewState() |
开始跟踪状态更改。Starts tracking state changes. (继承自 Style) |