如何将“查找”对话框中的文本框(编辑)更改为Delphi中的ComboBox?
我目前在我的delphi应用程序中使用标准 tfinddialog
:
img src =“ https://i.sstatic.net/fqzux.jpg”
< combobox的文本框?我想设置它,以便用户可以轻松地从历史记录中看到和选择:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您至少不能使用
tfinddialog
,因为它不允许使用自定义对话框模板(尽管 findtext() api api do do)。但是,您的情况还有另一个解决方法...
在
tfinddialog.onshow
事件中,使用findwindowex()
在对话框中手动查找编辑字段的hwnd
,然后使用shell的iautocomplete
接口启用该hwnd
上的下拉列表。您可以编写一个实现 noreferrer“>ienumstring
接口提供您要出现在该下拉列表中的条目(例如,通过包装tstringlist
您存储条目)。有关更多详细信息,请参见MSDN文档:
使用自动完成
如何启用自动完整的自动完整
href 请参阅:
此答案对于Delphi?
此答案 to
此答案tstringsadapter?
You can't, at least not with
TFindDialog
, as it does not allow the use of a custom dialog template (the underlyingFindText()
API does, though).However, there is another workaround for your situation...
In the
TFindDialog.OnShow
event, useFindWindowEx()
to manually find theHWND
of the Edit field in the dialog, and then use the Shell'sIAutoComplete
interface to enable a drop-down list on thatHWND
. You can write a class that implements theIEnumString
interface to provide the entries that you want to appear in that drop-down list (for instance, by wrapping aTStringList
that you store your entries in).See MSDN documentation for more details:
Using Autocomplete
How to Enable Autocomplete Manually
Also see:
This answer to Google like edit/combo control for Delphi?
This answer to Auto append/complete from text file to an edit box delphi
This answer to How to use IAutoComplete together with TStringsAdapter?