首页  编辑  

dbgrid中光标回车右移

Tags: /超级猛料/Friends.网友专栏/Single Wolf/   Date Created:

dbgrid 中光标回车右移

在Form.OnKeyPress事件中写如下代码:

if Key = #13 then

if ActiveControl = DBGrid1 then begin

TDBGrid(ActiveControl).SelectedIndex := TDBGrid(ActiveControl).SelectedIndex + 1;

Key := #0;

end;