views:

498

answers:

2

Hey!

I tried to find a solution but I didn't found what I was searching for. So here is my problem. I want a google like behaviour with a textbox. As I type "dum" it should find dummy in the database and display it as option under the textbox. It should be selectable. I don't use ASP.net or any other stuff. Just pure C#.

Thanks for your help!

+4  A: 

Set the AutoCompleteSource property to a list of strings, and set AutoCompleteSource to CustomSource and AutoCompleteMode to Suggest.

SLaks
This might give a preformance problem if there are a lot of entries in the database. I doubt Google uses this technique. I think they make a new query to load new suggestions on the fly every time you press a key.
Mark Byers
I guess for my needs this solution totally fits my needs. ;) Thanks SLaks and Mark Byers.
shevron
@Mark: Google doesn't use WinForms. It would be impossible for Google to do something similar because the the sheer volume of their suggestions (millions? billions?)
SLaks
+3  A: 

Check these ones out:

Hope this helps.

XpiritO