Partager via


PasswordRecovery.InstructionTextStyle Propriété

Définition

Obtient une référence à une collection de propriétés de style qui définissent l'apparence du texte explicatif dans le contrôle 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

Valeur de propriété

TableItemStyle

Référence au TableItemStyle qui contient des propriétés qui définissent l'apparence du texte explicatif.

Attributs

Exemples

L'exemple de code suivant montre comment définir la propriété 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>

Remarques

La InstructionTextStyle propriété définit l’apparence du texte explicatif dans le PasswordRecovery contrôle. Cette propriété est en lecture seule ; Toutefois, vous pouvez définir les propriétés de l’objet Style qu’il retourne. Vous pouvez définir les propriétés de manière déclarative dans le formulaireProperty-Subproperty, où Subproperty représente une propriété de la Style classe (par exemple). InstructionTextStyle-ForeColor Vous pouvez également définir les propriétés par programmation dans le formulaire Property.Subproperty (par exemple). InstructionTextStyle.ForeColor

Les paramètres courants incluent la couleur d’arrière-plan personnalisée, la couleur du texte et les propriétés de police. La InstructionTextStyle propriété définit l’apparence des propriétés suivantes :

Les paramètres de style apportés à la InstructionTextStyle propriété sont fusionnés avec les paramètres de style du PasswordRecovery contrôle. Tous les paramètres effectués dans la InstructionTextStyle propriété remplacent les paramètres correspondants dans les propriétés du PasswordRecovery contrôle.

Les propriétés de contrôle suivantes PasswordRecovery sont remplacées par InstructionTextStyle les propriétés :

Lorsque vous utilisez des modèles pour définir l’apparence de l’affichage UserName du contrôle ou de la PasswordRecovery vue Question, la InstructionTextStyle propriété n’a aucun effet.

S’applique à

Voir aussi