在dbgrid的onkeypress事件中
begin
if key=#13 then
if dbgrid1.selectedindex<(dbgrid1.fieldcount-1) then
dbgrid1.selectedindex:=dbgrid1.selectedindex+1
else
begin
if not adotable1.eof then
begin
adotable1.next;
dabgrid1.selectedindex:=0;
end;
end;
end;
begin
if key=#13 then
if dbgrid1.selectedindex<(dbgrid1.fieldcount-1) then
dbgrid1.selectedindex:=dbgrid1.selectedindex+1
else
begin
if not adotable1.eof then
begin
adotable1.next;
dabgrid1.selectedindex:=0;
end;
end;
end;
Shift: TShiftState);
begin
if key=13 then
key:=vk_Tab;
end;