ControlCollection.IndexOf メソッド
アセンブリ: System.Web (system.web.dll 内)

Dim instance As ControlCollection Dim value As Control Dim returnValue As Integer returnValue = instance.IndexOf(value)
戻り値
指定したサーバー コントロールのインデックス。サーバー コントロールが現在コレクションのメンバではない場合は -1 が返されます。


IndexOf メソッドを使用して、myLiteralControl コントロールのインデックス位置を、myButton という名前の Button コントロールの ControlCollection コレクションに書き込むコード例を次に示します。
' Create a LiteralControl and use the Add method to add it ' to a button's ControlCollection, then use the AddAt method ' to add another LiteralControl to the collection at the ' index location of 1. Dim myLiteralControl As LiteralControl = _ new LiteralControl("ChildControl1") myButton.Controls.Add(myLiteralControl) myButton.Controls.AddAt(1,new LiteralControl("ChildControl2")) Response.Write("<b>ChildControl2 is added at index 1</b>") ' Get the Index location of the myLiteralControl LiteralControl ' and write it to the page. Response.Write("<br><b>Index of the ChildControl myLiteralControl is </b>" & _ myButton.Controls.IndexOf(myLiteralControl))

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からControlCollection.IndexOf メソッドを検索する場合は、下記のリンクをクリックしてください。

- ControlCollection.IndexOf メソッドのページへのリンク