把 Form 的 KeyPreview 设为 true, 然后在 Form 的 OnKeyDown 事件中加入一下代码
  if Key = VK_RETURN then
    PostMessage(Handle, WM_NEXTDLGCTL, 0, 0);

解决方案 »

  1.   

    Procedure TForm1.FormKeyPress(Sender:Tobject;Var Key:Char);
    Begin
    if key=#13 then { 判断是按执行键}
    if not (ActiveControl is TStringGrid) Then
    Begin { 不是在TStringGrid控件内}
    key:=#0;
    perform(WM_NEXTDLGCTL,0,0);{移动到下一个控件}
    end else
    if (ActiveControl is TStringGrid) Then{是在 TStringGrid 控件内}
    begin
    With TStringGrid(ActiveControl) Do
    if Selectedindex<(FieldCount-1) then
    Selectedindex:=Selectedindex+1{ 移动到下一字段}
    else Selectedindex:=0;
    end;
    End;