带自动完成/建议列表的TEdit [英] TEdit with autocomplete / suggestion list
问题描述
我一直在想,是否存在一个具有类似于jQuery自动完成功能的自动完成功能的TEdit组件: http://jqueryui.com/autocomplete/
I've been wondering if there is a TEdit component with autocomplete function similar to jQuery autocomplete: http://jqueryui.com/autocomplete/
我想附加一个函数,该函数将使用LIKE命令通过许多字段在数据库中进行查找.然后,我将返回匹配记录的列表.也许一些DevExpress组件?我正在考虑创建自己的组件(例如TEdit下方的无边界表单)
I would like to attach to it a function which will seek through database by many fields with LIKE command. Then I would return a list of matching records. Maybe some DevExpress component? I am thinking of creating my own component (borderless form below the TEdit for example)
推荐答案
基础编辑控件对此具有支持,如文档中所述:如何手动启用自动完成功能.
The underlying edit control has support for this, as described in the documentation: Using Autocomplete and How to Enable Autocomplete Manually.
对您来说,这将有些棘手,因为您需要编写自己的自动完成源.这将涉及大量的COM编程.我不知道有任何知名的VCL包装器可以为您简化此过程.我建议您从MSDN链接中的C ++代码开始,并使其正常工作.您更有可能找到基于C ++代码的现成示例.一旦可以使用C ++做到这一点,将其转换为Delphi应该相对简单.
It's going to be a little tricky for you since you need to write your own autocomplete source. That's going to involve a fair amount of COM programming. I'm not aware of any well known VCL wrapper that will simplify this for you. I'd suggest that you start with the C++ code in the MSDN links and get that to work. You are much more likely to find ready made examples based on C++ code. Once you can do this with C++, it should be relatively straightforward to translate to Delphi.
这篇关于带自动完成/建议列表的TEdit的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!