PasswordRecovery.SubmitButtonStyle プロパティ

定義

PasswordRecovery コントロールの [送信] ボタンの外観を定義するプロパティのコレクションへの参照を取得します。

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

プロパティ値

[送信] ボタンの外観を定義するプロパティを格納している Style への参照。

属性

次のコード例は、コントロールのさまざまな種類の [送信] ボタンにプロパティを設定 SubmitButtonStyle する効果を PasswordRecovery 示しています。

<%@ 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 DropDownList1_SelectedIndexChanged(object Sender, EventArgs e)
  {
    if (DropDownList1.SelectedValue == "Button")
    {
      PasswordRecovery1.SubmitButtonType = ButtonType.Button;
      // <Snippet4>
      PasswordRecovery1.SubmitButtonText = "Enter User Name";
      // </Snippet4>
    }
  
    if (DropDownList1.SelectedValue == "Image")
    {
      PasswordRecovery1.SubmitButtonType = ButtonType.Image;
      // <Snippet3>
      PasswordRecovery1.SubmitButtonImageUrl = "userNameSubmit.png";
      // </Snippet3>
      PasswordRecovery1.SubmitButtonText = "Enter User Name Image";
    }
  
    if (DropDownList1.SelectedValue == "Link")
    {
      PasswordRecovery1.SubmitButtonType = ButtonType.Link;
      PasswordRecovery1.SubmitButtonText = "Enter User Name";
    }
  }
  
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
  <head>
    <title>ASP.NET Example</title>
</head>
  <body>
    <form id="Form1" runat="server">
      <table border="1">
        <tbody>
          <tr>
            <td>
              <asp:passwordrecovery id="PasswordRecovery1" runat="server"
                submitbuttonimageurl="userNameSubmit.png"
                submitbuttontext="Enter User Name">
                <submitbuttonstyle font-names="Comic Sans MS" 
                  forecolor="White" 
                  backcolor="#00C000">
                </submitbuttonstyle>
              </asp:passwordrecovery>
            </td>
            <td align="center">
              Choose a button type:<br />
              <asp:dropdownlist id="DropDownList1" runat="server" 
                onselectedindexchanged="DropDownList1_SelectedIndexChanged"
                autopostback="true">
                <asp:listitem value="Button">Button</asp:listitem>
                <asp:listitem value="Image">Image</asp:listitem>
                <asp:listitem value="Link">Link</asp:listitem>
              </asp:dropdownlist>
            </td>
          </tr>
        </tbody>
      </table>
    </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 DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
    If DropDownList1.SelectedValue = "Button" Then
      PasswordRecovery1.SubmitButtonType = ButtonType.Button
      ' <Snippet4>
      PasswordRecovery1.SubmitButtonText = "Enter User Name"
      ' </Snippet4>
    End If
    If DropDownList1.SelectedValue = "Image" Then
      PasswordRecovery1.SubmitButtonType = ButtonType.Image
      ' <Snippet3> -->
      PasswordRecovery1.SubmitButtonImageUrl = "userNameSubmit.png"
      ' </Snippet3> -->
      PasswordRecovery1.SubmitButtonText = "Enter User Name Image"
    End If
    If DropDownList1.SelectedValue = "Link" Then
      PasswordRecovery1.SubmitButtonType = ButtonType.Link
      PasswordRecovery1.SubmitButtonText = "Enter User Name"
    End If
  End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
  <head>
    <title>ASP.NET Example</title>
</head>
  <body>
    <form id="Form1" runat="server">
      <table border="1">
        <tbody>
          <tr>
            <td>
              <asp:passwordrecovery id="PasswordRecovery1" runat="server"
                submitbuttonimageurl="userNameSubmit.png"
                submitbuttontext="Enter User Name">
                <submitbuttonstyle font-names="Comic Sans MS" 
                  forecolor="White" 
                  backcolor="#00C000">
                </submitbuttonstyle>
              </asp:passwordrecovery>
            </td>
            <td align="center">
              Choose a button type:<br />
              <asp:dropdownlist id="DropDownList1" runat="server" 
                onselectedindexchanged="DropDownList1_SelectedIndexChanged"
                autopostback="true">
                <asp:listitem value="Button">Button</asp:listitem>
                <asp:listitem value="Image">Image</asp:listitem>
                <asp:listitem value="Link">Link</asp:listitem>
              </asp:dropdownlist>
            </td>
          </tr>
        </tbody>
      </table>
    </form>
  </body>
</html>

注釈

プロパティは SubmitButtonStyle 、コントロール内の [送信] ボタンの外観を PasswordRecovery 定義します。 このプロパティは読み取り専用です。ただし、返されるオブジェクトのプロパティを Style 設定できます。 これらのプロパティは、 という形式 Property-Subpropertyで宣言によって設定できます。ここで Subproperty 、 は クラスの Style プロパティを表します (例: SubmitButtonStyle-ForeColor)。 フォーム Property.Subproperty でプログラムでプロパティを設定することもできます (例: SubmitButtonStyle.ForeColor)。

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

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

PasswordRecovery のプロパティは、設定によって SubmitButtonStyle オーバーライドされます。

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

適用対象

こちらもご覧ください