procedure TFrmMain.FormKeyPress( Sender:TObject;
var Key: Char);
begin
if Key = #13 then
begin
if not ( ( ActiveControl is TCustomGrid ) or
( ActiveControl is TCustomMemo ) ) then
begin
Key := #0;
PostMessage( Handle, wm_NextDlgCtl, 0, 0 );
end
else if ( ActiveControl is TCustomGrid ) then
Key := #9;
end;
end;
procedure TFrmMain.DBGrid1KeyDown( Sender: TObject;
var Key: Word; Shift: TShiftState );
begin
if Key = vk_Return then
Key := vk_Tab;
end;