通过在列表框vb.net中键入来搜索ListBox中的项目 [英] search for items in a ListBox by typing in list box vb.net

查看:312
本文介绍了通过在列表框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


这篇关于通过在列表框vb.net中键入来搜索ListBox中的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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