Hello,
I have a ComboBox in my WinForm which has data from SQL server (used LINQ to bring up the data).

I'd like to have an option just like AutoComplete in VB.NET but not only by the first letter but for a search LIKE.

For Example:
My ComboBox has there texts:
"nighty night"
"hi and goodbye"
"food is good"

So what i'd like to do is when i start typing for example the word "good"
a list of options will appear (just like AutoComplete with suggest)
and i can choose from:
"hi and goodbye"
"food is good"

Is this option available?

Thanks in advanced,
Shay.

Recommended Answers

All 5 Replies

In the Combobox's property window

Set AutoCompleteMode to Append
Set AutoCompleSource to ListItems

In the Combobox's property window

Set AutoCompleteMode to Append
Set AutoCompleSource to ListItems

Thanks but this doesn't help, putting in a list does exactly
the same as original autoComplete, while i need to complete
any LIKE word that was typed (and not only by the first letter).

01) Set the DropDownStyle to "DropDown" to allow editing
AutoCompleSource = ListItems
And
AutoCompleteMode = Append or SuggestAppend depending on if you want the items automatically selected or just suggested.

shayacov.... nobody seems to understand... but now I have exactly the same problem! :(

I'll try to explain better:

I set the combobox as tomw suggest.. good!

My items are:

- shiny apple
- apple pie
- nowhere to go

I write "app" in the box. What WE want VBNET to do is having both "shiny apple" and "apple pie" to autocomplete. In our case we got only "apple pie"
In SQL terms:
-> vb net does "app" LIKE '<string>%'
-> WE wanted "app" LIKE '%<string>%'

I can't explain better than that. Is there a way to go?

hello did this problem solved? I have this problem also. Could you help me.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.