PasswordRecovery.TitleTextStyle Proprietà

Definizione

Ottiene un riferimento a un insieme di proprietà di stile che definiscono l'aspetto del testo del titolo visualizzato nel controllo PasswordRecovery.

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

Valore della proprietà

TableItemStyle

Riferimento a un oggetto TableItemStyle che contiene le proprietà che definiscono l'aspetto del testo del titolo nel controllo PasswordRecovery.

Attributi

Esempio

Nell'esempio di codice seguente viene utilizzata la TitleTextStyle proprietà per modificare l'aspetto delle UserNameTitleText proprietà e QuestionTitleText .

<%@ page language="C#" %>

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

  void PasswordRecovery1_UserLookupError(object sender, EventArgs e)
  {
    PasswordRecovery1.UserNameTitleText = "Try again";
    PasswordRecovery1.TitleTextStyle.ForeColor = System.Drawing.Color.Red;
  }
  
  void PasswordRecovery1_AnswerLookupError(object sender, EventArgs e)
  {
    PasswordRecovery1.QuestionTitleText = "Try again";
    PasswordRecovery1.TitleTextStyle.ForeColor = System.Drawing.Color.Red;
  }
  
</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" 
    questiontitletext="Password Confirmation Question"
    usernametitletext="Get a new password" OnUserLookupError="PasswordRecovery1_UserLookupError" OnAnswerLookupError="PasswordRecovery1_AnswerLookupError">
    <titletextstyle 
      font-names="Arial" 
      font-bold="True" 
      forecolor="White" 
      backcolor="Gray">
    </titletextstyle>
  </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">

  
  Sub PasswordRecovery1_UserLookupError(ByVal sender As Object, ByVal e As System.EventArgs)
    PasswordRecovery1.UserNameTitleText = "Try again"
    PasswordRecovery1.TitleTextStyle.ForeColor = System.Drawing.Color.Red
  End Sub
  
  Sub PasswordRecovery1_AnswerLookupError(ByVal sender As Object, ByVal e As System.EventArgs)
    PasswordRecovery1.QuestionTitleText = "Try again"
    PasswordRecovery1.TitleTextStyle.ForeColor = System.Drawing.Color.Red
  End Sub
</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" 
    questiontitletext="Password Confirmation Question"
    usernametitletext="Get a new password" OnUserLookupError="PasswordRecovery1_UserLookupError" OnAnswerLookupError="PasswordRecovery1_AnswerLookupError">
    <titletextstyle 
      font-names="Arial" 
      font-bold="True" 
      forecolor="White" 
      backcolor="Gray">
    </titletextstyle>
  </asp:passwordrecovery>

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

Commenti

La TitleTextStyle proprietà definisce l'aspetto del testo del titolo della visualizzazione nel PasswordRecovery controllo . Questa proprietà è di sola lettura; Tuttavia, è possibile impostare le proprietà dell'oggetto Style restituito. È possibile impostare queste proprietà in modo dichiarativo nel formato Property-Subproperty, dove Subproperty rappresenta una proprietà della Style classe , ad esempio TitleTextStyle-ForeColor. È anche possibile impostare le proprietà a livello di codice nel modulo Property.Subproperty , ad esempio TitleTextStyle.ForeColor.

Le impostazioni comuni includono il colore di sfondo personalizzato, il colore del testo e le proprietà del carattere.

Le impostazioni di stile per la TitleTextStyle proprietà vengono unite alle impostazioni di stile per il PasswordRecovery controllo . Tutte le impostazioni effettuate nella TitleTextStyle proprietà sostituiscono le impostazioni corrispondenti nelle proprietà del PasswordRecovery controllo.

Le proprietà seguenti PasswordRecovery vengono sostituite dalle TitleTextStyle impostazioni:

Quando si usano modelli per definire l'aspetto del PasswordRecovery controllo, la TitleTextStyle proprietà non ha alcun effetto.

Si applica a

Vedi anche