Procedure TForm1.FormKeyPress (Sender: Tobject; Var Key: Char); Begin if key = # 13 帖子# 0; Perform (WM_NEXTDLGCTL, 0, 0); {move to next control} end else if (ActiveControl is TDBGrid) then // in the TDBGrid begin with TDBGrid (ActiveControl) do begin if selectedindex <(fieldcount -1) then / / If it is not the last field selectedIndex: = SELECTEDINDEX 1 ELSE SELECTEDINDEX: = 0; End; end; end;