Share via


Login.InstructionTextStyle 屬性

定義

取得 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

屬性值

TableItemStyle 的參考,包含 Login 控制項指示文字的樣式設定。

屬性

範例

下列程式碼範例會設定 屬性所 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 中的對應設定。

設定會覆寫 InstructionTextStyle 下列 Login 樣式屬性:

當您使用範本來定義控制項的外觀 Login 時, InstructionTextStyle 屬性不會有任何作用。

適用於

另請參閱