开发者

.NET Custom search on combobox auto-complete

I have a combobox control in my form. I have enabled autocomplete feature in suggest mode. By default, the co开发者_Go百科ntrol suggests all the strings which starts with the text the user have introduced. Is there any way to change this behavior to make the control suggest all the strings which contains current text?

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


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.


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


Use the combobox OnTextChanged event and do something like this:

foreach (string item in combobox.items)
    string.Contains(items);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜