查找listbox项的内容
// Set the search string:
string myString = "Isabella";
// Search starting from index -1:
int index = listBox1.FindString(myString, -1);
if (index != -1)
{
// Select the found item:
listBox1.SetSelected(index, true);
// Send a success message:
MessageBox.Show("Found the item \"" + myString +
"\" at index: " + index);
}
else
MessageBox.Show("Item not found.");
浙公网安备 33010602011771号