0

This is my code:

foreach(var item in listBox1.Items)
{
    string i = item.ToString();
    if (item.ToString()== "myItem")
    {
        label1.Text = i.ToString(); // how to get the founded item index?
        break; 
    }    
}

There is a loop in a ListBox for finding a specific item. After finding that item I want to know what is the index of that item in the ListBox?

Sinatr
  • 20,892
  • 15
  • 90
  • 319
Vlad
  • 115
  • 7

0 Answers0