组合框自动完成自定义功能 [英] ComboBox AutoComplete Custom Capabilities

查看:110
本文介绍了组合框自动完成自定义功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何延长一个WinForm ComboBox的自动完成功能,例如,发现使用正则表达式的项目,或为简单起见,找项目的比赛,其中包含输入的文本?

How can I extend the AutoComplete feature of a WinForm ComboBox to, for example, find matches of items using a regular expression or for simplicity to find items that contains the text entered?

推荐答案

有关寻找最符合哪些用户键入现有列表项,您可以设置的 AutoCompleteMode 的组合框来AutoCompleteMode.Append和的 AutoCompleteSource 来AutoCompleteSource.ListItems。

For finding the existing list item that best matches what the user has typed, you can set the AutoCompleteMode property on the ComboBox to AutoCompleteMode.Append and the AutoCompleteSource to AutoCompleteSource.ListItems.

如果你想使用更复杂的逻辑来执行自动完成,看看做的TextChanged事件东西。 一个例子

If you want to use more complex logic to perform the auto-complete, look at doing something with the TextChanged event. An Example

这篇关于组合框自动完成自定义功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆