如何在VB6中创建自动完成ComboBox? [英] How can I create an autocomplete ComboBox in VB6?

查看:226
本文介绍了如何在VB6中创建自动完成ComboBox?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用VB6下的默认ComboBox控件,使其成为一个聪明的ComboBox?
我们假设这些值已经在ComboBox中填充。例如:

Is it possible to use the default ComboBox control under VB6 to make it a smart ComboBox? We suppose that the values are already populated in the ComboBox. For example:

New Delhi
New World
New York

我们需要ComboBox来响应一个默认事件,因此当用户写入N时,ComboBox中的值将是第一个值以N开始。在我们的情况下,它是新德里,然后用户可以继续输入,直到他们写确切的单词或他写的东西不同。
这种技术非常适用于web应用程序(例如在Google中,当您输入第一个单词时,您会得到一个包含建议的下拉列表)。
但是如何在VB6中这样做: - (

We need the ComboBox to respond to one of the default events, so when for example the user writes 'N' the value in the ComboBox will be the first Value starting by 'N'. In our case it's New Delhi and then the user can continue typing till they write the exact word or he writes something different. This technique is very used in web Application (for example in Google when you put the first word you will get a droped down list containing the suggestions). But how to do that in VB6 :-(

如果不可能,我们如何保持ComboBox下降,在组合框中的改变和ComboBox中的第一个元素对应于以用户输入的值开头的第一个单词?

In case its not possible, how can we keep the ComboBox droped down, the values changes when the text in the comboBox change and the first element in the ComboBox correspond to the first word starting by the value entered by the user?

非常感谢。

推荐答案

您还可以查看这个控件从vbAccelerator.com,它支持自动完成。vbAccelerator代码通常是高质量的。当然,你引入了一个依赖项每当您使用第三方控件时,都会使用此代码。

You might also want to look at this control from vbAccelerator.com, which supports auto-completion. The vbAccelerator code is usually high quality. Of course you're introducing quite a dependency into your code whenever you use a third-party control.

这篇关于如何在VB6中创建自动完成ComboBox?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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