vb.net Code:
Do While (name <> (ListBox1.Items.Item(num))) And (num < max) **i keep getting an error in this line** num = num + 1 ListBox1.Items.Add(num) ' what? Loop
So if you find a matching item in the Listbox add it's number to the Listbox items making what presumably is a long list (otherwise why have a search facility at all) even longer? How does that make any sense?
Do you have Option Strict On because that would certainly raise an error on that line because of all the implicit conversions required. I would probably use a For Each loop here and simply select any matches within the ListBox but then I'm really not sure what you're actually doing this for in the first place. What happens when you've found the item? The fact that it's in a ListBox means that there aren't really a lot of options going forward from that point.




Reply With Quote
