[Lazarus] Making a auto-complete dropdown list

Flávio Etrusco flavio.etrusco at gmail.com
Sun Apr 26 15:57:36 CEST 2009


On Sat, Apr 25, 2009 at 6:27 AM, Yan Chengyuan <yanchengyuan at gmail.com> wrote:
> Hi,all!
> Recently i've been working on a mess: making my own dropdown list,which
> (i wish) has the following characteristics:
>
> *Sort the items according to their LCS(Longest Common Subsequence) with
> the text
> *auto-complete
> *response to some specified key-press event
>
> firstly i created a form called "DropDownForm",put a ListBox on it.
> on another form i put a Tedit.when the text is changed,i'll sort the
> items of the ListBox,set the dropdownform's position,and make it appear.
> but i've been faced with this fact:when the dropdownform is shown,the
> TEdit losts its focus,even if i wrote"Edit1.SetFocus".So that when i
> type something, what changed is not the text of the TEdit, but the
> ListBox instead. and that makes it impossible to implement the
> sort-while-typing function.
>
> Can anyone help me?Thanks in advance.
>
> Regards,
> Yan Chengyuan
>

What widgetset and what Lazarus version are you using?
With latest Lazarus svn on Windows this works without a problem.

Best regards,
Flávio




More information about the Lazarus mailing list