比如现在的焦点在第一行第一列,当第一行第一列输入完毕后,焦点自动跳到第一行第二列
解决方案 »
- 怎么取得网页数据?
- IDE环境下delphi关闭出错
- Delphi编译出来的Exe程序是机器代码吗?
- 关于Hoursbetween函数
- 请教关于TClientDataSet的问题,请进来看看。
- 请问TTreeView怎么用?
- 谢谢大家!在一个月前,我曾写过这样一个帖子http://expert.csdn.net/Expert/topic/1658/1658294.xml?temp=.7847864
- 急、5,5,5!!!
- 在MDI 程序设计中,如果要在MDIFORM 中加背景图片怎么办?
- 哪个API可以返回WindowName?
- 我的程序由于是大循环加小循环 导致CPU 100%,如何解决或者有好的方法
- 关于时间
焦点自动跳转不是问题,
关键是不知道你什么时候完毕!
dbgrid.DataSource.DataSet.Next;
中间还要考虑Post和Edit操作!
begin
SelectedIndex := Selectedindex + 1;
end;
Shift: TShiftState);
begin
//按回车就跳到下一行
if Key = VK_RETURN then
DBGrid1.SelectedIndex := DBGrid1.SelectedIndex + 1;
end;
procedure TForm1.DBGrid1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = VK_RETURN then
begin
if DBGrid1.SelectedIndex <> (DBGrid1.FieldCount-1) then
begin
DBGrid1.SelectedIndex := DBGrid1.SelectedIndex + 1;
end
else begin
DBGrid1.SelectedIndex := 0;
table1.Next;
end;
end;
end;
能新建记录的代码:
procedure TForm1.DBGrid1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
if Key = VK_RETURN then
begin
if DBGrid1.SelectedIndex <> (DBGrid1.FieldCount-1) then
begin
DBGrid1.SelectedIndex := DBGrid1.SelectedIndex + 1;
end
else begin
DBGrid1.SelectedIndex := 0;
table1.Next;
end;
if table1.Eof and (DBGrid1.SelectedIndex = (DBGrid1.FieldCount-2)) then
begin
table1.Append;
table1.Edit;
end;
end;
end;
反正在Delphi7环境下通过了,不知道是不是楼主想要的功能。