VB.net ComboBox自动下拉输入 [英] VB.net ComboBox auto drop down on input
问题描述
我想创建一个ComboBox,它会根据输入自动删除包含字母的字词。我的下拉菜单是下拉框,所以组合框有一个输入字段。
I want to create a ComboBox that automaitcally drops down the words containing the letter based on the input. My dropdownstyle is dropdown so the combobox has an input field.
例如,我将输入字母A或a我想要ComboBox自动下拉包含字母A或a。 ComboBox的内容是由我自己手动设置的。
For example i would input the letter A or a I want the ComboBox to automatically dropdown the words which contains the letter A or a. The contents of the ComboBox are being set by myself manually.
这是可能吗?提前感谢。
Is this possible? Thanks in advance.
推荐答案
您必须设置这些
AutoCompleteMode: SuggestAppend
AutoCompleteSource: ListItems
DropDownStyle: DropDown
$ b b
假设您的组合有这些项目,那么您必须将它们添加到autocompletecustomsource
Suppose your combo has these items then you have to add them to the autocompletecustomsource also
ComboBox1.Items.Add("10")
ComboBox1.Items.Add("92")
ComboBox1.Items.Add("9000")
ComboBox1.Items.Add("9001")
ComboBox1.AutoCompleteCustomSource.Add("10")
ComboBox1.AutoCompleteCustomSource.Add("92")
ComboBox1.AutoCompleteCustomSource.Add("9000")
ComboBox1.AutoCompleteCustomSource.Add("9001")
ComboBox1.AutoCompleteSource = AutoCompleteSource.CustomSource
这篇关于VB.net ComboBox自动下拉输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!