É uma função, utilizo dos componentes TDBEdit:
procedure TFrmCliente.ConsEditAsBairroChange(Sender: TObject); function Procura(Txt: string): String; var iA: Integer; begin with Bai_temp do if TXT <> '' then FOR iA:=0 to PRED(COUNT) do IF (LSTRCMP(PCHAR(COPY(STRINGS[iA],1,LENGTH(TXT))),PCHAR(TXT))=0) OR (LSTRCMPI(PCHAR(COPY(STRINGS[iA],1,LENGTH(TXT))),PCHAR(TXT))=0) THEN BEGIN RESULT:=STRINGS[iA]; BREAK; END; end; var iA, iB: Integer; begin if (Bai_Temp = nil) or (dsTabela.Dataset.State = dsBrowse) then Exit; if not bpausa and active then begin if procura(ConsEditAsBairro.text) <> '' then begin ib:=length(ConsEditAsBairro.text); ConsEditAsBairro.text:=procura(ConsEditAsBairro.text); ConsEditAsBairro.selstart:=ib; ConsEditAsBairro.sellength:=length(procura(ConsEditAsBairro.text))-ib; end; end; bpausa:=false; for ia := 0 to Bai_Temp.Count - 1 do if Bai_Temp.strings[ia] = ConsEditAsBairro.text then begin Bai_Temp.Strings[ia]; break; end else Bai_Temp.Strings[0]; end; //aqui carrego a lista with Dados.IBSQL do begin Close; SQL.Clear; SQL.Add('select distinct CLENDER from CLIENTES order by CLENDER'); ExecQuery; end; End_Temp := TStringList.Create; End_temp.Clear; while not Dados.IBSQL.Eof do begin End_temp.Add(Dados.IBSQL.FieldByName('CLENDER').AsString); Dados.IBSQL.Next; end; --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.782 / Virus Database: 528 - Release Date: 22/10/2004 -- <<<<< FAVOR REMOVER ESTA PARTE AO RESPONDER ESTA MENSAGEM >>>>> Para ver as mensagens antigas, acesse: http://br.groups.yahoo.com/group/delphi-br/messages Para falar com o moderador, envie um e-mail para: [EMAIL PROTECTED] ou [EMAIL PROTECTED] Links do Yahoo! Grupos <*> Para visitar o site do seu grupo na web, acesse: http://br.groups.yahoo.com/group/delphi-br/ <*> Para sair deste grupo, envie um e-mail para: [EMAIL PROTECTED] <*> O uso que você faz do Yahoo! Grupos está sujeito aos: http://br.yahoo.com/info/utos.html