Login.InstructionTextStyle 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取对定义 TableItemStyle 控件中指令文本设置的对象的 Login 引用。
public:
property System::Web::UI::WebControls::TableItemStyle ^ InstructionTextStyle { System::Web::UI::WebControls::TableItemStyle ^ get(); };
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)]
public System.Web.UI.WebControls.TableItemStyle InstructionTextStyle { get; }
[<System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)>]
member this.InstructionTextStyle : System.Web.UI.WebControls.TableItemStyle
Public ReadOnly Property InstructionTextStyle As TableItemStyle
属性值
对包含控件指令文本样式设置的Login引用TableItemStyle。
- 属性
示例
下面的代码示例通过设置属性所引用InstructionTextStyle对象的属性TableItemStyle来设置指令文本的说明文本和背景色。
<%@ Page Language="C#" AutoEventWireup="False"%>
<!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>
<title>ASP.NET Example</title>
</head>
<body>
<form id="form1" runat="server">
<asp:Login id="Login1" runat="server"
InstructionText="Enter your user name and password to log in.">
<InstructionTextStyle Font-Bold="True" ForeColor="#E0E0E0" BackColor="Gray"></InstructionTextStyle>
</asp:Login>
</form>
</body>
</html>
<%@ Page Language="VB" AutoEventWireup="False"%>
<!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>
<title>ASP.NET Example</title>
</head>
<body>
<form id="form1" runat="server">
<asp:Login id="Login1" runat="server"
InstructionText="Enter your user name and password to log in.">
<InstructionTextStyle Font-Bold="True" ForeColor="#E0E0E0" BackColor="Gray"></InstructionTextStyle>
</asp:Login>
</form>
</body>
</html>
注解
该 InstructionTextStyle 属性定义控件中 Login 指令文本的外观。 此属性为只读;但是,可以设置它返回的对象的属性 TableItemStyle 。 可以在窗体 Property-Subproperty中以声明方式设置这些属性,其中 Subproperty 表示 TableItemStyle 类的属性(例如, InstructionTextStyle-ForeColor)。 您可以以编程方式在窗体 Property.Subproperty 中设置属性(例如, InstructionTextStyle.ForeColor)。
常见设置包括自定义背景色、文本颜色和字体属性。 该 InstructionTextStyle 属性定义属性的外观 InstructionText 。
属性的 InstructionTextStyle 样式设置与控件的 Login 样式设置合并。 属性 InstructionTextStyle 中所做的任何设置都覆盖控件属性 Login 中的相应设置。
以下 Login 样式属性由 InstructionTextStyle 设置重写:
使用模板定义控件的外观 Login 时,该 InstructionTextStyle 属性不起作用。