2012-02-01 10 views

答えて

1

Listbox.Textを使用して試してください。Listbox は、指定したテキストに一致するListBox内の項目を検索し、その項目を選択します。

ListBox.Text= "string Value" ; 
+0

ありがとう、................... –

+0

foreach(lbxempname.ItemsのListItemアイテム) { string neww = Convert.ToString(item); if(Convert.ToString(item)== Givenstring) { item.Selected = true; this.imgbtnedit_Click(null、null); } } –

1

私はあなたがこのような何かを探していると思う:

foreach (var item in ListBox.Items) 
{ 
    if (item.Text.Contains(stringToBeSearched)) 
    { 
     //select item in the ListBox 
     ListBox.SelectedValue = item.Value; 
     break; 
    } 
} 

は、この情報がお役に立てば幸いです。

+0

はい私は結果を得ました。ああ、そんなにありがとう.. –

+0

ありがとう。 –

関連する問題