PasswordRecovery.InstructionTextStyle Proprietà

Definizione

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

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

Valore della proprietà

TableItemStyle

Riferimento a un oggetto TableItemStyle che contiene le proprietà che definiscono l'aspetto del testo esplicativo.

Attributi

Esempio

Nell'esempio di codice riportato di seguito viene illustrato come impostare la proprietà InstructionTextStyle.

<%@ 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">

  // <Snippet2>
  void PasswordRecovery1_UserLookupError(object sender, EventArgs e)
  {
    PasswordRecovery1.UserNameInstructionText = "Enter the correct Web site user name.";
    PasswordRecovery1.InstructionTextStyle.ForeColor = System.Drawing.Color.Red;
  }
  // </Snippet2>
  
  // <Snippet4>
  void PasswordRecovery1_AnswerLookupError(object sender, EventArgs e)
  {
    PasswordRecovery1.QuestionInstructionText = "Enter the correct answer to this question.";
    PasswordRecovery1.InstructionTextStyle.ForeColor = System.Drawing.Color.Red;
  }
  // </Snippet4>
  
</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" 
    questioninstructiontext="Enter the answer to the password confirmation question."
    usernameinstructiontext="Enter your Web site user name." 
    OnUserLookupError="PasswordRecovery1_UserLookupError" OnAnswerLookupError="PasswordRecovery1_AnswerLookupError">
    <instructiontextstyle 
      font-size="Smaller" 
      font-names="Comic Sans MS" 
      font-italic="True" 
      forecolor="Blue">
    </instructiontextstyle>
  </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">

  ' <Snippet2>
  Sub PasswordRecovery1_UserLookupError(ByVal sender As Object, ByVal e As System.EventArgs)
    PasswordRecovery1.UserNameInstructionText = "Enter the correct Web site user name."
    PasswordRecovery1.InstructionTextStyle.ForeColor = System.Drawing.Color.Red
  End Sub
  ' </Snippet2>
  
  ' <Snippet4>
  Sub PasswordRecovery1_AnswerLookupError(ByVal sender As Object, ByVal e As System.EventArgs)
    PasswordRecovery1.QuestionInstructionText = "Enter the correct answer to this question."
    PasswordRecovery1.InstructionTextStyle.ForeColor = System.Drawing.Color.Red
  End Sub
  ' </Snippet4>
</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" 
    questioninstructiontext="Enter the answer to the password confirmation question."
    usernameinstructiontext="Enter your Web site user name." 
    OnUserLookupError="PasswordRecovery1_UserLookupError" OnAnswerLookupError="PasswordRecovery1_AnswerLookupError">
    <instructiontextstyle 
      font-size="Smaller" 
      font-names="Comic Sans MS" 
      font-italic="True" 
      forecolor="Blue">
    </instructiontextstyle>
  </asp:passwordrecovery>
</form>
</body>
</html>

Commenti

La InstructionTextStyle proprietà definisce l'aspetto del testo esplicativo nel PasswordRecovery controllo. Questa proprietà è di sola lettura; tuttavia, è possibile impostare le proprietà dell'oggetto Style restituito. È possibile impostare le proprietà dichiarative nel formato Property-Subproperty, dove Subproperty rappresenta una proprietà della Style classe , ad esempio InstructionTextStyle-ForeColor. È anche possibile impostare le proprietà a livello di codice nel modulo Property.Subproperty , ad esempio InstructionTextStyle.ForeColor.

Le impostazioni comuni includono colori di sfondo personalizzati, colore di testo e proprietà del tipo di carattere. La InstructionTextStyle proprietà definisce l'aspetto delle proprietà seguenti:

Le impostazioni di stile apportate alla InstructionTextStyle proprietà vengono unite alle impostazioni di stile per il PasswordRecovery controllo. Tutte le impostazioni effettuate nella proprietà eseguono l'override InstructionTextStyle delle impostazioni corrispondenti nelle proprietà del PasswordRecovery controllo.

Le proprietà del controllo seguenti PasswordRecovery vengono sostituite dalle InstructionTextStyle proprietà:

Quando si usano modelli per definire l'aspetto della PasswordRecovery visualizzazione UserName del controllo o della visualizzazione Question, la InstructionTextStyle proprietà non ha alcun effetto.

Si applica a

Vedi anche