El siguiente codigo es del evento en un boton, que tambien atrapa el ENTER.
Código Delphi
[-]
procedure TfrmLogin.btnValidarClick(Sender: TObject);
begin
ShowMessage( 'ERROR' );
edtUsuario.SetFocus;
end;
A continuacion el evento que hace el trabajo de poner el foco al siugiente control:
Código Delphi
[-]
procedure TfrmLogin.FormKeyUp(Sender: TObject;
var Key: Word; Shift: TShiftState);
begin
if (ActiveControl is TEdit) then
begin
if Key = VK_RETURN then
SelectNext(ActiveControl, True, True);
end;
if Key = VK_ESCAPE then
Close;
end;
El formulario consta de 2 TEdit, y 2 TButton, al presionar enter sobre un BOTON, me muestra el mensaje de error, y deberia pasar el foco a un TEdit, pero al parecer el formulario atrapa este enter y hace que se pase al SIGUIENTE control
Bueno espero me ayuden, Salu2