通过在列表框vb.net中键入来搜索ListBox中的项目

问题描述:

我有一个列表框和列表框中的一些项目。

例如:如果我有像
这样的项目
ba

bb

bc

bcd

...



在列表框中当我输入列表框中的字母时,我需要选择最匹配的项目

如果我键入ba,它会选择项目ba。如果我输入bcd,它会选择项目bcd等。如何让列表框像那样工作?请帮助

I have a list box and some items in the list box.
for eg : if I have the items like
ba
bb
bc
bcd
...

in the list box when I type in the letters in listbox I need to select the item most match
if I type "ba" it suppose to select item "ba". If I type "bcd" it suppose to select item "bcd" etc. How to make the list box to work like that? Please help

你想要自动完成功能



有一个codeproject文章在其中 [ ^ ]创建一个自定义控件



并且 MSDN [ ^ ]处理内置功能
You want "autocomplete" functionality

There is a codeproject article here[^] which creates a custom control

and there is some stuff on MSDN[^] that deals with the built in functionality