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

Dim instance As ListItemCollection Dim text As String Dim returnValue As ListItem returnValue = instance.FindByText(text)
戻り値
text パラメータで指定されたテキストを格納している ListItem。

FindByText メソッドを使用して、text パラメータで指定されたテキストを格納している Text プロパティを持つ ListItem をコレクション内で検索します。このメソッドは、大文字と小文字を区別し、カルチャに依存しない比較を実行します。このメソッドは、部分検索またはワイルドカード検索は実行しません。この検索条件を使用して項目がコレクション内で見つからない場合は、null 参照 (Visual Basic では Nothing) が返されます。

Dim myListItem As ListItem = SearchType.SelectedItem Dim crItem As ListItem Dim searchText As String = TextBox1.Text If(myListItem.Value = "Name") Then If(TextBox1.Text <> "" ) Then Dim searchSubfirst As String = searchText.Substring(0,1) Dim searchSubsecond As String = searchText.Substring(1) searchText = searchSubfirst.ToUpper()+searchSubsecond.ToLower() ' Search by country or region name. crItem = ItemCollection.FindByText(searchText) End If Else 'Search by country or region code. crItem = ItemCollection.FindByValue(searchText.ToUpper()) End If Dim str As String = "Search is successful. Match is Found.<br>" str = str & "The results for search string '" & searchText & "' are:<br>" str = str & "the country or region code is: " & crItem.Value & "<br>" str = str & "the country or region name is: " & crItem.Text ' Add the string to the label. Label1.Text = str
ListItem myListItem = SearchType.SelectedItem; ListItem crItem = null; String searchText = TextBox1.Text; if(myListItem.Value == "Name") { if(TextBox1.Text != "") { String searchSubfir = searchText.Substring(0,1); String searchSubsec = searchText.Substring(1); searchText = searchSubfir.ToUpper()+searchSubsec.ToLower(); // Search by country or region name. crItem = ItemCollection.FindByText(searchText); } } else { // Search by country or region code. crItem = ItemCollection.FindByValue(searchText.ToUpper()); } String str = "Search is successful. Match is Found.<br>"; str =str + "The results for search string '" + searchText + "' are:<br>"; str = str + "the country or region code is " + crItem.Value + "<br>"; str = str + "the country or region name is " + crItem.Text; // Add the string to the label. Label1.Text = str;

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に収録されているすべての辞書からListItemCollection.FindByText メソッドを検索する場合は、下記のリンクをクリックしてください。

- ListItemCollection.FindByText メソッドのページへのリンク