views:

269

answers:

3

Hi everybody,

I have a combobox control in my form. I have enabled autocomplete feature in suggest mode. By default, the control suggests all the strings wich starts with the text the user have introduced. Is there any way to change this behaviour to make the control suggest all the strings wich contains current text?

I'm trying to avoid creating a custom control to make that.

Thanks in advance.

+1  A: 

I don't believe so; documentation only mentions matching based on prefixes, and from my experience with the ComboBox I don't believe it's possible.

STW
A: 

Use the combobox OnTextChanged event and do something like this:

foreach (string item in combobox.items)
    string.Contains(items);
Tony
Yes, I've tryied that. I captured TextChenged event to rebuild the AutoCompleteStringCollection but it remains suggesting only the items widh starts by the current text.
lluismontero
+1  A: 

ACO_NOPREFIXFILTERING is not introduced until Windows Vista. Supporting the behavior in Windows Forms would be a breaking change.

Sheng Jiang 蒋晟