Topic: [Script] Quick search for ComboBox

It allows you to quickly find the desired value in the list ComboBox


procedure Form1_edGroupSearch_OnChange (Sender: string);
begin
    Form1.cbGroups.dbFilter := 'groupname LIKE "%'+ Form1.edGroupSearch.Text +'%"';
    UpdateDatabase('groups');

    if Form1.cbGroups.Items.Count = 2 then
    begin
        Form1.cbGroups.DroppedDown:=False;
        Form1.cbGroups.ItemIndex := 1;
    end else Form1.cbGroups.DroppedDown:=True;
end;

begin
    Form1.edGroupSearch.TextHint := 'Search for groups...';
end.

Download project:
http://myvisualdatabase.com/forum/misc. … download=1

Dmitry.

Re: [Script] Quick search for ComboBox

can not search in ComboBox itself not in edGroupSearch.Text     

.Style  := csDropDown;  and use it as search filed  and result show up down in same comboBox ?

Thanks

Re: [Script] Quick search for ComboBox

abouyahya527911 wrote:

can not search in ComboBox itself not in edGroupSearch.Text     

.Style  := csDropDown;  and use it as search filed  and result show up down in same comboBox ?

Thanks


Example for you:

Post's attachments

Attachment icon Search in ComboBox 2.zip 56.16 kb, 1097 downloads since 2016-03-26 

Dmitry.

Re: [Script] Quick search for ComboBox

working like charm .

Thanks