Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的
MessageBox.Show(listbox.Items[0].ToString());
是
"abber"
如何使用“abber”找到列表框项索引 0?
和listbox.Items.IndexOf("abber")
listbox.Items.IndexOf("abber")
那是:
int curIndex = listbox.Items.IndexOf("abber"); if(curIndex >= 0) { MessageBox.Show(listbox.Items[curIndex].ToString()); }
int index = listBox1.Items.IndexOf("Specify string here");