在comboBox控件中选择数据 [英] Selecting a data in a comboBox control

查看:64
本文介绍了在comboBox控件中选择数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Windows窗体应用程序的comboBox1中,有超过100个学生名称可用。 comboBox1按字母顺序排序。如果用户想要选择以R开头的名称,则用户必须滚动comboBox1以选择该特定名称,这是一种耗时的方法。我想应用一个设施,比如当用户写第一个字母R时,只有以R开头的名称应该在comboBox1中突出显示,如果再次用户写第二个字母就像RA一样,应该显示以RA开头的名字。但我不知道怎么做?请有人通过提供正确的代码来帮助我。

In a comboBox1 in my Windows Form Application, there are more than 100 Student Name available. The comboBox1 is sorted alphabetically. If the user wants to select a name starting with R, the user has to scroll the comboBox1 to select that particular name which is a time consuming method. I want to apply a facility like when the user write the first letter R, only the name starting with R should be highlighted in the comboBox1, if again the user write the second letter like RA the name starting with RA should be displayed. But I don’t know how to do this? Please somebody help me by giving proper codes.

推荐答案

是的这称为自动完成,你需要一个自动完成组合框才能做到这一点。所以请遵循这个教程和答案,建立你自己的一个:

自动完成组合框 [ ^ ]

AC#auto complete combo box [ ^ ]

自动完成ComboBox控制数据库 [ ^ ]

http://www.how2prog.com/autocomplete-combobox -c / [ ^ ]

http://stackoverflow.com/questions/11780558/c- sharp-winforms-combobox-dynamic-autocomplete [ ^ ]

http:// stackoverflow .com / questions / 5570810 / autocomplete-combobox-c-sharp [ ^ ]
Yes this is called auto-completeness and you need an autocomplete combobox to do that.So follow this tutorials and answers and build your own one:
Auto Complete ComboBox[^]
A C# auto complete combo box[^]
AutoComplete ComboBox Control From Database[^]
http://www.how2prog.com/autocomplete-combobox-c/[^]
http://stackoverflow.com/questions/11780558/c-sharp-winforms-combobox-dynamic-autocomplete[^]
http://stackoverflow.com/questions/5570810/autocomplete-combobox-c-sharp[^]


这篇关于在comboBox控件中选择数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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