PasswordRecovery.InstructionTextStyle Właściwość

Definicja

Pobiera odwołanie do kolekcji właściwości stylu, które definiują wygląd tekstu objaśnianego w kontrolce 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

Wartość właściwości

TableItemStyle

Odwołanie do TableItemStyle obiektu zawierającego właściwości definiujące wygląd tekstu objaśnianego.

Atrybuty

Przykłady

Poniższy przykład kodu pokazuje, jak ustawić InstructionTextStyle właściwość.

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

Uwagi

Właściwość InstructionTextStyle definiuje wygląd tekstu objaśnianego w kontrolce PasswordRecovery . Ta właściwość jest tylko do odczytu; można jednak ustawić właściwości zwracanego Style obiektu. Właściwości można ustawić deklaratywnie w postaci Property-Subproperty, gdzie Subproperty reprezentuje właściwość Style klasy (na przykład InstructionTextStyle-ForeColor). Właściwości można również ustawić programowo w formularzu Property.Subproperty (na przykład InstructionTextStyle.ForeColor).

Typowe ustawienia obejmują niestandardowy kolor tła, kolor tekstu i właściwości czcionki. Właściwość InstructionTextStyle definiuje wygląd następujących właściwości:

Ustawienia stylu wprowadzone we InstructionTextStyle właściwości są scalane z ustawieniami stylu kontrolki PasswordRecovery . Wszystkie ustawienia wprowadzone we InstructionTextStyle właściwości zastępują odpowiednie ustawienia we właściwościach kontrolki PasswordRecovery .

Następujące PasswordRecovery właściwości kontrolki są zastępowane przez InstructionTextStyle właściwości:

Jeśli używasz szablonów do definiowania wyglądu PasswordRecovery widoku UserName kontrolki lub widoku Pytania, InstructionTextStyle właściwość nie ma wpływu.

Dotyczy

Zobacz też