设置好tableorder 然后
onkeyup
case Key of
VK_Return://响应回车键。
begin
if not (ActiveControl is TDBGrid) and not (ActiveControl is TMemo) then
begin
PerForm(WM_NEXTDLGCTL, 0, 0);
end
else
if (ActiveControl is TDBGrid) then
with TDBGrid(ActiveControl) do
if selectedIndex < (FieldCount - 1) then
selectedIndex := selectedIndex + 1
else
selectedIndex := 0;
end;