Código
{No campo edit, ou dbedit, no evento OnKeyPres adicione }
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if key=#27 then
begin
if Sender is TWinControl then
if (TWinControl(Sender).ComponentIndex + 1) <= ComponentCount +1 then
Control(Components[TWinControl(Sender).ComponentIndex -1]).SetFocus;
end;
// se quiser utilizar o enter para passer a casa seguinte acrescente
if key=#13 then
begin
if Key=#13 then
begin
if Sender is TWinControl then
if (TWinControl(Sender).ComponentIndex + 1) <= ComponentCount -1 then
TWinControl(Components[TWinControl(Sender).ComponentIndex + 1]).SetFocus;
end;
end;
end;
{em seguida selecione todos os campos utilizados no form e no evento OnKeyPress coloque o campo que que foi gerado (edit1.KeyPress)
Planeta Delphi - www.planetadelphi.com.br - Todos os direitos reservados | Copyright 2001-2009