B Beebs Oct 20, 2005 #1 Quick question...how do I iterate through the items of a listbox and highlight the item that matches a text string I'm searching for?
Quick question...how do I iterate through the items of a listbox and highlight the item that matches a text string I'm searching for?
? =?ISO-8859-1?Q?Linus_R=F6rstad?= Oct 20, 2005 #2 Beebs said: Quick question...how do I iterate through the items of a listbox and highlight the item that matches a text string I'm searching for? Click to expand... I would write something like this: for(int i = 0; i < listBox1.Items; i++) { if(textSearchedFor == listBox1.Items.ToString()) listBox1.SelectedIndex = i; } Sincerly Linus
Beebs said: Quick question...how do I iterate through the items of a listbox and highlight the item that matches a text string I'm searching for? Click to expand... I would write something like this: for(int i = 0; i < listBox1.Items; i++) { if(textSearchedFor == listBox1.Items.ToString()) listBox1.SelectedIndex = i; } Sincerly Linus