PasswordRecovery.InstructionTextStyle プロパティ

定義

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

プロパティ値

TableItemStyle

説明テキストの外観を定義するプロパティを格納している TableItemStyle への参照。

属性

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>

注釈

このプロパティは InstructionTextStyle 、コントロール内の説明テキストの外観を PasswordRecovery 定義します。 このプロパティは読み取り専用です。ただし、返されるオブジェクトのプロパティを Style 設定できます。 プロパティは、クラスのプロパティ (たとえばInstructionTextStyle-ForeColor) Subproperty を表すStyleフォームProperty-Subpropertyで宣言によって設定できます。 フォーム Property.Subproperty (たとえば InstructionTextStyle.ForeColor) でプログラムでプロパティを設定することもできます。

一般的な設定には、ユーザー設定の背景色、テキストの色、およびフォント プロパティが含まれます。 このプロパティは InstructionTextStyle 、次のプロパティの外観を定義します。

プロパティに対して InstructionTextStyle 行われたスタイル設定は、コントロールのスタイル設定 PasswordRecovery とマージされます。 プロパティで行われた設定は、 InstructionTextStyle コントロールのプロパティ内の対応する設定を PasswordRecovery オーバーライドします。

PasswordRecovery のコントロール プロパティは、プロパティによって InstructionTextStyle オーバーライドされます。

テンプレートを使用してコントロールの UserName ビューまたは質問ビューの PasswordRecovery 外観を定義する場合、 InstructionTextStyle プロパティは無効になります。

適用対象

こちらもご覧ください