I have a large amount of items in a listBox called listBox1. I also have a textBox (textBox1) at the top. I want to be able to type into the textBox and the listBox searches through it's item's and finds ones that contain what I am typing.
For example, say the listBox contains
"Cat"
"Dog"
"Carrot"
and "Brocolli"
If I start typing the letter C, then I want it to show both Cat and Carrot, when I type a it should keep showing them both, but when I add an r it should remove Cat from the list. Is there anyway to do this?
Here's an pretty good example: http://www.java2s.com/Code/CSharp/Components/UseanAutocompleteComboBox.htm
Filter the listbox. Try this:
I think you need to use a linq query and then databind the result. An example of this in WPF is here, but I believe you can do the same in winforms.
For getting result which the asked expects, you have to use Contains method instead StartWith method. Like this:-
I was in search for this.
Rudimentary example; however this should get you started...