关于网友提出的“ 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