MFC:如何动态创建/显示类智能列表框? [英] MFC: how to dynamically create/show intellisense-like list box?
问题描述
我想在MFC对话框中为编辑控件添加类似intellisense的功能。 基本思想是用户开始输入编辑控件,并根据用户输入的内容(例如数字,字母),然后应用程序将动态
弹出一个列表框,其中包含用户随后可以选择的建议。   这与intellisense在Visual Studio中的工作方式相当。例如,下图显示了智能感知在VS2015中显示的动态列表框。
我想将这种类型的功能添加到MFC编辑控件。
I would like to add intellisense-like functionality to an edit control in an MFC dialog. The basic idea is the user starts typing in an edit control and, depending on what the user types (e.g. numbers, letters), then the application will dynamically popup a list box containing suggestions that the user can then select from. This is comparable to how intellisense works in Visual Studio. For example, the image below illustrates the dynamic list box that intellisense displays in VS2015. I would like to add this type of functionality to an MFC edit control.
是否有人知道MFC,MFC功能包或任何开源库是否提供此功能? 或者这是我必须从头开始构建的东西?自从我上次与MFC合作以来已经有一段时间了,我希望那些拥有MFC经验
的人能够指出我正确的方向。
Is anyone aware if MFC, the MFC feature pack or any open source libraries offer this functionality? Or is this something I will have to build from scratch? It has been quite a while since I last worked with MFC and I'm hoping those with more experience
with MFC will be able to point me in the right direction.
谢谢,
Ian
Ian
推荐答案
这不是微不足道的,但您可以调整自动填充以满足您的目标。 Shell函数提供的实现 SHAutoComplete
适用于网址和文件系统。 但是底层的IAutoComplete接口可以自定义。 请参阅
使用自动完成功能和
如何手动启用自动填充。
It's not trivial but you might be able to adapt Autocomplete to meet your objecive. The implementation provided by the Shell function SHAutoComplete works for URLs and the file system. But the underlying IAutoComplete interface can be customized. See Using AutoComplete and How to Enable Autocomplete Manually.
这篇关于MFC:如何动态创建/显示类智能列表框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!