views:

146

answers:

1

I (think I) want to develop a custom control for my program in VB .net where I type into a textbox and simple search results will then be displayed underneath it (from a predefined set of items). Like auto suggest in google search.

I believe the combobox does something similar to this but I think it only works on prefixes.

At the moment I have a separate search form from which I use to filter a lot of possibilities and then use drag-and-drop to get the desired item into a TextBox.

So ideally I want to combine this with a TextBox into which one can start typing at which point some results will be displayed and a user can select the item they want. (Say, an item from a list of products)

Is this a good idea? How can I go about it best? Does it already exist?

It has been bugging me for AGES!

Help appreciated!

+3  A: 

This functionality is supported out of the box in Windows Forms 2.0 and beyond. Check out the AutoCompleteSource and AutoCompleteMode properties of both the TextBox and ComboBox windows forms objects.

Steve Danner
This doesn't allow for more advanced searches, this is just prefixes.I want to combine the advanced features of a search form with the TextBox.
clawson
You might have to override the AutoComplete abilities using something like this: http://stackoverflow.com/questions/515561/how-can-i-dynamically-change-auto-complete-entries-in-a-c-combobox-or-textbox. At which point, you're almost back to your original idea of wrapping it all up in a custom control. The OOTB auto complete capabilities should lighten the load a bit, though.
Steve Danner