my
MessageBox.Show(listbox.Items[0].ToString());
is
"abber"
how can I find listbox item index 0 with "abber"?
my
MessageBox.Show(listbox.Items[0].ToString());
is
"abber"
how can I find listbox item index 0 with "abber"?
With listbox.Items.IndexOf("abber")
That is:
int curIndex = listbox.Items.IndexOf("abber");
if(curIndex >= 0)
{
MessageBox.Show(listbox.Items[curIndex].ToString());
}
int index = listBox1.Items.IndexOf("Specify string here");