PasswordRecovery.SuccessTextStyle 屬性

定義

取得樣式屬性集合的參考,這些樣式屬性定義 PasswordRecovery 控制項之 [成功] 檢視中顯示的文字外觀。

public:
 property System::Web::UI::WebControls::TableItemStyle ^ SuccessTextStyle { System::Web::UI::WebControls::TableItemStyle ^ get(); };
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)]
public System.Web.UI.WebControls.TableItemStyle SuccessTextStyle { get; }
[<System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)>]
member this.SuccessTextStyle : System.Web.UI.WebControls.TableItemStyle
Public ReadOnly Property SuccessTextStyle As TableItemStyle

屬性值

TableItemStyle

TableItemStyle 的參考,包含了定義 [成功] 檢視中顯示之文字外觀的屬性。

屬性

範例

下列程式碼範例會 SuccessTextStyle 使用 屬性來變更 屬性的外觀 SuccessText

<%@ page language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>ASP.NET Example</title>
</head>
<body>
<form id="form1" runat="server">
    <asp:passwordrecovery id="PasswordRecovery1" runat="server" 
        successtext="Your password has been sent to the email address in our files.">
        <successtextstyle font-names="Arial" forecolor="Green"></successtextstyle>
    </asp:passwordrecovery>

</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">
<script runat="server">

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>ASP.NET Example</title>
</head>
<body>
<form id="form1" runat="server">
    <asp:passwordrecovery id="PasswordRecovery1" runat="server" 
        successtext="Your password has been sent to the email address in our files.">
        <successtextstyle font-names="Arial" forecolor="Green"></successtextstyle>
    </asp:passwordrecovery>

</form>
</body>
</html>

備註

屬性 SuccessTextStyle 會在 控制項的 [成功] 檢視 PasswordRecovery 中定義文字的外觀。 此屬性是唯讀的;不過,您可以設定其傳回之 Style 物件的屬性。 您可以在 表單 Property-Subproperty 中宣告設定這些屬性,其中 Subproperty 代表類別的屬性 Style (,例如, SuccessTextStyle-ForeColor) 。 您也可以在表單 Property.Subproperty 中以程式設計方式設定屬性 (,例如, SuccessTextStyle.ForeColor) 。

常見的設定包括自訂背景色彩、文字色彩和字型屬性。

屬性的 SuccessTextStyle 樣式設定會與控制項的 PasswordRecovery 樣式設定合併。 屬性中 SuccessTextStyle 所做的任何設定會覆寫 控制項屬性 PasswordRecovery 中的對應設定。

設定會覆寫 SuccessTextStyle 下列 PasswordRecovery 屬性:

當您使用範本來定義控制項 [成功] 檢視 PasswordRecovery 的外觀時, SuccessTextStyle 屬性不會有任何作用。

適用於

另請參閱