Ver Mensaje Individual
  #3  
Antiguo 23-11-2011
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Reputación: 38
ecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to behold
Hola.

Creo que vas a lograr un efecto similar a lo que buscas usando un TComboBox con su propiedad Style = csSimple:
Código Delphi [-]
...
implementation
CONST
  CBOX_HEIGHT = 21;

procedure TForm1.FormCreate(Sender: TObject);
begin
  with ComboBox1 do
  begin
    Style:= csSimple;
    CharCase:= ecUpperCase;
    Text:= '';
    Height:= CBOX_HEIGHT;
  end;
end;

procedure TForm1.ComboBox1Change(Sender: TObject);
begin
  with TComboBox(Sender) do
  begin
    if Text > '' then
    begin
      Query.Close;
      Query.SQL.Clear;
      Query.SQL.Add('SELECT CAMPO FROM TABLA');
      Query.SQL.Add('WHERE CAMPO LIKE UPPER(:VALOR)');
      Query.ParamByName('VALOR').AsString:= ComboBox1.Text+'%';
      Query.Open;
      while not Query.Eof do
      begin
        if Items.IndexOf(Query.FieldByName('CAMPO').AsString) = -1 then
          ComboBox1.Items.Add(Query.FieldByName('CAMPO').AsString);
        Query.Next;
      end;
      Height:= DropDownCount * CBOX_HEIGHT;
    end
    else
    begin
      Clear;
      Height:= CBOX_HEIGHT;
    end;
  end;
end;

Saludos.
__________________
Daniel Didriksen

Guía de estilo - Uso de las etiquetas - La otra guía de estilo ....
Responder Con Cita