Ver Mensaje Individual
  #12  
Antiguo 25-07-2003
Avatar de marcoszorrilla
marcoszorrilla marcoszorrilla is offline
Capo
 
Registrado: may 2003
Ubicación: Cantabria - España
Posts: 11.221
Reputación: 10
marcoszorrilla Va por buen camino
Prueba con este código, no lo termino porque hoy es fiesta y estoy un poco vago pero creo que básicamente te puede servir:
Código:
  private
    { Private declarations }
    MyBuffer:String;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if key in['A'..'z','Ñ','ñ']then
MyBuffer:=MyBuffer + Key;
end;

procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
if Key = Vk_Back then
MyBuffer:=Copy(MyBuffer,1,Length(MyBuffer) -1);
end;

procedure TForm1.Edit1Change(Sender: TObject);
begin
  if Table1.FindKey([MyBuffer]) then
  Edit1.Text:=Table1Nombre.AsString
  else
  begin
  Table1.FindNearest([MyBuffer]);
  Edit1.Text:=Table1Nombre.AsString;
  Edit1.SelStart:=Length(MyBuffer);
  Edit1.SelLength:=Length(Edit1.text);
  end;
end;
Un Saludo.
Responder Con Cita