procedure TForm1.Form1Down(Sender: TObject;
var Key: Word;
Shift: TShiftState);
begin
if key=13 then
if not(activecontrol is tdbgrid) then
begin
key:=0;
perform(WM_NEXTDLGCTL,0,0);
end else
if (ActiveControl is tdbgrid) then
begin
with tdbgrid(activecontrol)do
if Selectedindex<(fieldcount-1) then
selectedindex:=selectedindex+1
else
selectedindex:=0;
end;
end;