ListItemCollection.FindByValue メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > ListItemCollection.FindByValue メソッドの意味・解説 

ListItemCollection.FindByValue メソッド

指定した値を格納している Value プロパティを持つ ListItem をコレクションで検索ます。

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

Public Function FindByValue ( _
    value As String _
) As ListItem
Dim instance As ListItemCollection
Dim value As String
Dim returnValue As ListItem

returnValue = instance.FindByValue(value)
public ListItem FindByValue (
    string value
)
public:
ListItem^ FindByValue (
    String^ value
)
public ListItem FindByValue (
    String value
)
public function FindByValue (
    value : String
) : ListItem

パラメータ

value

検索対象の値。

戻り値
value パラメータ指定した値を格納している ListItem

解説解説
使用例使用例
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;

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ListItemCollection クラス
ListItemCollection メンバ
System.Web.UI.WebControls 名前空間
FindByText
ListItem クラス
ListItem.Value プロパティ



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

辞書ショートカット

すべての辞書の索引

ListItemCollection.FindByValue メソッドのお隣キーワード
検索ランキング

   

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



ListItemCollection.FindByValue メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS