WebControl.TabIndex プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > WebControl.TabIndex プロパティの意味・解説 

WebControl.TabIndex プロパティ

Web サーバー コントロールタブ インデックス取得または設定します

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

例外例外
例外種類条件

ArgumentOutOfRangeException

指定したタブ インデックスが、-32768 から 32767 の間にありません。

解説解説
使用例使用例

WebControl の TabIndex プロパティ使用してページ上のコントロールタブ オーダー設定する方法の例を次に示します

メモメモ

次のコード サンプルはシングルファイル コード モデル使用しており、分離コード ファイル直接コピーされ場合正常に動作しない可能性あります。このコード サンプルは、拡張子.aspx の空のテキスト ファイルコピーする必要がありますWeb フォームコード モデル詳細については、「ASP.NET Web ページコード モデル」を参照してください

<%@ Page Language="VB" AutoEventWireup="True"
 %>

<html>
 <body>
     <h3>TabIndex Property of a Web Control<br></h3>
 
 <script Language="VB" runat="server">
 
    Sub SubmitBtn1_Click(sender As Object,
 e As EventArgs)
        SubmitBtn1.TabIndex = 0
        If TextBox1.Text = "" Then
            TextBox1.TabIndex = 0
        Else
            TextBox1.TabIndex = System.Int16.Parse(TextBox1.Text)
        End If
        If TextBox2.Text = "" Then
            TextBox2.TabIndex = 0
        Else
            TextBox2.TabIndex = System.Int16.Parse(TextBox2.Text)
        End If
        If TextBox3.Text = "" Then
            TextBox3.TabIndex = 0
        Else
            TextBox3.TabIndex = System.Int16.Parse(TextBox3.Text)
        End If
    End Sub
 
 </script>
 
 <form runat=server>
 
     Type in the numbers 1, 2, or 3 as
 the desired tab order 
     for the following text boxes, <br> 
     Click the Submit button, and <br> 
     Tab through the text boxes to verify:<p>
 
     <asp:Button id="SubmitBtn1" OnClick="SubmitBtn1_Click"
 Text="Submit" runat="server"/>
     <p>
 
     <asp:TextBox id="TextBox1" BackColor="Pink"
 runat="server"/>
     <p>
 
     <asp:TextBox id="TextBox2" BackColor="LightBlue"
 runat="server"/>
     <p>
 
     <asp:TextBox id="TextBox3" BackColor="LightGreen"
 runat="server"/>
     <p>  
     
 </form>
 
 </body>
 </html>

<%@ Page Language="C#" AutoEventWireup="True" %>

<html>
 <body>
     <h3>TabIndex Property of a Web Control<br></h3>
 
 <script Language="C#" runat="server">
 
     void SubmitBtn1_Click(Object sender, EventArgs e) {
     SubmitBtn1.TabIndex = 0;
     TextBox1.TabIndex = (short)((TextBox1.Text=="") ? 0 : System.Int32.Parse(TextBox1.Text));
     TextBox2.TabIndex = (short)((TextBox2.Text=="") ? 0 : System.Int32.Parse(TextBox2.Text));
     TextBox3.TabIndex = (short)((TextBox3.Text=="") ? 0 : System.Int32.Parse(TextBox3.Text));
     }
 
 </script>
 
 <form runat=server>
 
     Type in the numbers 1, 2, or 3 as the desired tab order 
     for the following text boxes, <br> 
     Click the Submit button, and <br> 
     Tab through the text boxes to verify:<p>
 
     <asp:Button id="SubmitBtn1" OnClick="SubmitBtn1_Click"
 Text="Submit" runat="server"/>
     <p>
 
     <asp:TextBox id="TextBox1" BackColor="Pink" runat="server"/>
     <p>
 
     <asp:TextBox id="TextBox2" BackColor="LightBlue" runat="server"/>
     <p>
 
     <asp:TextBox id="TextBox3" BackColor="LightGreen" runat="server"/>
     <p>  
     
 </form>
 
 </body>
 </html>

<%@ Page Language="JScript" AutoEventWireup="True" %>

<html>
 <body>
     <h3>TabIndex Property of a Web Control<br></h3>
 
 <script Language="JSCRIPT" runat="server">
 
    function SubmitBtn1_Click(sender : Object, e : EventArgs){
        SubmitBtn1.TabIndex = 0
        if(TextBox1.Text == "")
            TextBox1.TabIndex = 0
        else
            TextBox1.TabIndex = System.Int16.Parse(TextBox1.Text)
        if(TextBox2.Text == "")
            TextBox2.TabIndex = 0
        else
            TextBox2.TabIndex = System.Int16.Parse(TextBox2.Text)
        if(TextBox3.Text == "")
            TextBox3.TabIndex = 0
        else
            TextBox3.TabIndex = System.Int16.Parse(TextBox3.Text)
    }
 
 </script>
 
 <form runat=server>
 
     Type in the numbers 1, 2, or 3 : the desired tab order 
     for the following text boxes, <br> 
     Click the Submit button, and <br> 
     Tab through the text boxes to verify:<p>
 
     <asp:Button id="SubmitBtn1" OnClick="SubmitBtn1_Click"
 Text="Submit" runat="server"/>
     <p>
 
     <asp:TextBox id="TextBox1" BackColor="Pink" runat="server"/>
     <p>
 
     <asp:TextBox id="TextBox2" BackColor="LightBlue" runat="server"/>
     <p>
 
     <asp:TextBox id="TextBox3" BackColor="LightGreen" runat="server"/>
     <p>  
     
 </form>
 
 </body>
 </html>

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「WebControl.TabIndex プロパティ」の関連用語

WebControl.TabIndex プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



WebControl.TabIndex プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS