-2

I've been wondering if there is a TEdit component with autocomplete function similar to jQuery autocomplete: http://jqueryui.com/autocomplete/

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)

Flash
  • 466
  • 6
  • 16
  • Something like this, [Google like edit/combo control for Delphi?](http://stackoverflow.com/q/2012208/576719) – LU RD Oct 01 '14 at 09:17
  • A lot of components exist for this purpose so adding your own seems a bit too complicated. (Also: If my memory does not fail me the early D7 times when there was no specific component for that purpose we used a combo box with csSimple sytle or something like that.) – mg30rg Oct 01 '14 at 09:28
  • Or this,[Auto append/complete from text file to an edit box delphi](http://stackoverflow.com/questions/5465590/auto-append-complete-from-text-file-to-an-edit-box-delphi) – SimaWB Oct 01 '14 at 09:32
  • I would expect a combo box for this (from a UX point of view). A combo box with items filtered by what is written in its edit. From time to time it happens to me that I just forget what I wanted to search and I would stay lost with that jQuery autocomplete edit. – TLama Oct 01 '14 at 09:50

2 Answers2

2

The underlying edit control has support for this, as described in the documentation: Using Autocomplete and How to Enable Autocomplete Manually.

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.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • You won't be able to implement *fulltext* search (what that jQuery component does) with `IAutoComplete`. It matches the text just from the beginning; that's why I wrote [`this`](http://stackoverflow.com/a/9472014/960757) ugly bunch of code (as an example). – TLama Oct 01 '14 at 10:07
0

use "mru edit" or "lookup combobox"

Ased Zarif
  • 21
  • 1