您好,欢迎来到[编程问答]网站首页   源码下载   电子书籍   软件下载   专题
当前位置:首页 >> 编程问答 >> Delphi >> DBGrid1怎样按回车代替TAB键

DBGrid1怎样按回车代替TAB键

来源:网络整理     时间:2016/8/12 14:23:30     关键词:

关于网友提出的“ DBGrid1怎样按回车代替TAB键”问题疑问,本网通过在网上对“ DBGrid1怎样按回车代替TAB键”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:

问题: DBGrid1怎样按回车代替TAB键
描述:

DBGrid1怎样按回车代替TAB键


解决方案1:

procedure TForm1.DBGrid1KeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
begin
 if(DBGrid1.SelectedIndex=DBGrid1.FieldCount-1) Then
 Begin
    DBGrid1.SelectedIndex:=0;
    ADOQuery1.Next;
 End
 Else
    DBGrid1.SelectedIndex:=DBGrid1.SelectedIndex+1;
end;
end;

解决方案2:

procedure TForm1.DBGrid1KeyPress(Sender: TObject; var Key: Char);
begin
 if(DBGrid1.SelectedIndex=DBGrid1.FieldCount-1) Then
 Begin
    DBGrid1.SelectedIndex:=0;
    ADOQuery1.Next;
 End
 Else
    DBGrid1.SelectedIndex:=DBGrid1.SelectedIndex+1;
end;


以上介绍了“ DBGrid1怎样按回车代替TAB键”的问题解答,希望对有需要的网友有所帮助。
本文网址链接:http://www.codes51.com/itwd/3227527.html

相关图片

相关文章