Ver Mensaje Individual
  #3  
Antiguo 29-02-2008
Minio Minio is offline
Miembro
 
Registrado: jul 2007
Ubicación: Elche (Alicante) ESPAÑA
Posts: 65
Reputación: 17
Minio Va por buen camino
Este código es el que tengo puesto en el evento OnDrawColumCell del DBGrid.

Ahora te paso una imagen para que te hagas una idea

Código Delphi [-]
procedure TFmAlbCli.DBGDatosDrawColumnCell(Sender: TObject;
  const Rect: TRect; DataCol: Integer; Column: TColumn;
  State: TGridDrawState);
begin
  DBGDatos.Columns[0].Font.Color := clBlue;
  with (Sender as TDBGrid) do
    begin
      if DMGestion.TDetAlb.RecNo mod 2 = 0 then
        begin
          Canvas.Brush.Color := clYellow;
          if DBCPOnline.Checked = True then
            begin
              Columns[5].Font.Size := 6;
              Columns[6].Font.Size := 6;
            end
            //Canvas.Font.Size := 6
          else
            begin
              Columns[5].Font.Size := 8;
              Columns[6].Font.Size := 8;
            end
            //Canvas.Font.Size := 8;
        end
      else
        begin
          Canvas.Brush.Color := clWhite;
          if DBCPOnline.Checked = True then
            begin
              Columns[5].Font.Size := 6;
              Columns[6].Font.Size := 6;
            end
            //Canvas.Font.Size := 6
          else
            begin
              Columns[5].Font.Size := 8;
              Columns[6].Font.Size := 8;
            //Canvas.Font.Size := 8;
            end
        end;
        DefaultDrawColumnCell(Rect, DataCol, Column, State);
    end;
  if (gdSelected in State) then
      begin
        DBGDatos.Canvas.Brush.Color := clBlue;
        DBGDatos.Canvas.Font.Style := [fsBold];
        DBGDatos.Canvas.Font.Color := clWhite;
        DBGDatos.DefaultDrawColumnCell(Rect, Datacol, Column, State);
      end;
end;
Responder Con Cita