Ver Mensaje Individual
  #12  
Antiguo 05-01-2011
Avatar de Aleca
Aleca Aleca is offline
Miembro
 
Registrado: may 2003
Ubicación: Venado Tuerto, Argentina
Posts: 277
Reputación: 21
Aleca Va por buen camino
A ver ahora
Código Delphi [-]
....
  private
    { Private declarations }
    nValorAnt: Integer;
    FColor, BColor: TColor;
  public
    { Public declarations }
  end;
var
  Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.DBGDatosDrawColumnCell(Sender: TObject; const Rect: TRect;
  DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
  if State = [] then
  begin
    if nValorAnt <> TblArticulosID_GRUPO.AsInteger then
    begin
      nValorAnt := TblArticulosID_GRUPO.AsInteger;
      if BColor = clWhite then
      begin
        FColor := clWhite;
        BColor := clGreen;
      end
      else
      begin
        FColor := clBlack;
        BColor := clWhite;
      end;
    end;
    TDBGrid(Sender).Canvas.Font.Color := FColor;
    TDBGrid(Sender).Canvas.Brush.Color := BColor;
  end
  else
    TDBGrid(Sender).Canvas.Font.Color := clWhite;
  TDBGrid(Sender).DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
  nValorAnt := 0;
  FColor := clWhite;
  BColor := clGreen;
end;
end.
__________________
Aleca
Responder Con Cita