I currently use a standard TFindDialog
in my Delphi application:
How can I change the textbox to a combobox? I'd like to set it up so that the user can easily see and select from the history, like this:
I currently use a standard TFindDialog
in my Delphi application:
How can I change the textbox to a combobox? I'd like to set it up so that the user can easily see and select from the history, like this:
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?