在dbgrid的keyPredd事件中作如下判断
可是焦点向下移动
if key=#13 then
begin
table1.next;
key:=#0;
end;
如要移动到下一列
if key=#13 then
beign
selectedindex:=selectedindex+1
key:=#0;
end
//selectedfield:=fields[selectedindex];
procedure TForm1.Button1Click(Sender: TObject);
var
AA: TObject;
begin
AA:=QRBand1.AddPrintable(TQRLabel);
with TQRLabel(AA) do begin
Size.Left:=50;
Size.Top:=5;
Caption:='Dynamic Colmn';
end;
end;
Procedure TForm1.FormKeyPress(Sender:Tobject;Var Key:Char);
Begin
if key=#13 then
if (ActiveControl is TDbgrid) Then
begin
With TDbgrid(ActiveControl) Do
if Selectedindex<(FieldCount-1) then
Selectedindex:=Selectedindex+1
else Selectedindex:=0;
end;
end;
Procedure TForm1.FormKeyPress(Sender:Tobject;Var Key:Char);
Begin
if key=#13 then
if (ActiveControl is TDbgrid) Then
begin
With TDbgrid(ActiveControl) Do
if Selectedindex<(FieldCount-1) then
Selectedindex:=Selectedindex+1
else if not table(或quarry).EOF then
begin
Selectedindex:=0;
table.Next;
end ;
end;
end;