Ver Mensaje Individual
  #2  
Antiguo 20-08-2007
krlosrp krlosrp is offline
Miembro
 
Registrado: ago 2007
Posts: 18
Reputación: 0
krlosrp Va por buen camino
Re: Algo mas sobre DBGrid !!!

Prueba con esto.

procedure
Tform1.Enter(Sender: TObject; var Key: Char);
begin
if (Key = #13) and (ActiveControl is = TEdit) or (ActiveControl isTDBEdit) then
begin
Key := #0;
SelectNext(ActiveControl, GetKeyState(VK_SHIFT) and $80 = 0, True);
end
else if (ActiveControl is TDBGrid) then
if Key= #9 then {Con Tab salimos del grid hacia delante }
SelectNext(ActiveControl, true, True)
else
with TDBGrid(ActiveControl) do
if selectedindex < (fieldcount -1) then
selectedindex := selectedindex +1
else
selectedindex := 0;
end;

procedure TForm1.DBGrid1KeyPress(Sender: TObject; var Key: Char);
begin
Enter(Self,Key);
end;
Responder Con Cita