看下面代码:
procedure TFrmlr.DBGEhKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
with q do
begin
if key=13 then
begin
if rb1.Checked then //控制光标向下还是向右
begin
if dbgeh.SelectedField.ReadOnly then
key:=9
else
if Eof then
begin
key:=9;
First;
end
else
next;
end
else
key:=9;
end;
end;
end;