Title: An easy way and very powerfull way to have AutoComplete Search in TListBox
Question: How we can have autosearch ability for TListBox. For example if you type "m" listbox automatically go to the first item that start with "m" and then if you typed "o" it automatically go to the first item that it started with "mo" and so on.
Answer:
IT's really easy! Very Very easy
I see this tip in a site. sorry I forgott the name of the site
First of all put an TListBox and TEdit component in the form.
Now set the Visible property of you TEditBox to False.
OK!
Now just copy these line on "OnKeyDown" event of your TListBox:
var
tmpPChar : PChar;
begin
GetMem(tmpPChar, Length(Edit1.Text) + 1);
StrPCopy(tmpPChar, Edit1.Text);
Your ListBox Name.Perform(LB_SELECTSTRING, 0, LongInt(tmpPChar));
FreeMem(tmpPChar, Length(Edit1.Text) + 1);
Finished!
Have Fun!