【发布时间】:2013-07-10 19:07:27
【问题描述】:
我的
MessageBox.Show(listbox.Items[0].ToString());
是
"abber"
如何使用“abber”找到列表框项索引 0?
【问题讨论】:
-
请说明您的要求
标签: c# windows-phone-7 listbox indexing
我的
MessageBox.Show(listbox.Items[0].ToString());
是
"abber"
如何使用“abber”找到列表框项索引 0?
【问题讨论】:
标签: c# windows-phone-7 listbox indexing
与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");
【讨论】: