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
?