08-02-2013, 08:51 AM
I usually keep all listbox item in a List<string> and when i search for something in the list u can loop trough that list and add everything that matches to the listbox
According to MSDN:
2
FindString has 2 overloads:
2
Have you looked at this:
2
List<int> foundIndexes = new List<int>();
int index = -1, firstIndex = -1;
while ((index = listBox1.FindString("test", index)) !=-1){
if(index == firstIndex ){
break;
}
if (firstIndex == -1){
firstIndex = index;
}
foundIndexes.Add(index);
}
FindString only looks for string that starts with your string, if you want to search for strings that are exactly like your string use FindStringExact:
2
2
thanks again someone and wiza.
works perfectly.

