Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #5  
Antiguo 07-08-2008
[coso] coso is offline
Miembro Premium
 
Registrado: may 2008
Ubicación: Girona
Posts: 1.678
Poder: 0
coso Va por buen camino
hola,
seria algo asi

Código Delphi [-]
procedure T_main.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
  DataCol: Integer; Column: TColumn; State: TGridDrawState);
var
        x : integer;
begin
        if (gdSelected in state) then
        (sender as TDBGrid).canvas.Brush.Color := $00C08000
        else
        if (sender as TDBGrid).datasource.dataset.RecNo mod 2 = 0 then
        (sender as TDBGrid).canvas.Brush.Color := clAqua - $000b0b0b
        else
        (sender as TDBGrid).canvas.Brush.Color := clAqua - $00010101;

        (sender as TDBGrid).canvas.FillRect(Rect);

        if Column.Field <> nil then
        begin
        case  Column.Alignment of
         taCenter : x := (Rect.Right - Rect.Left) div 2 - (sender as TDBGrid).canvas.TextWidth(Column.Field.asstring) div 2;
         taLeftJustify : x := 0;
         taRightJustify : x := Rect.Right - (sender as TDBGrid).canvas.TextWidth(Column.Field.asstring);
         end;

        (sender as TDBGrid).DefaultDrawing := true;
        (sender as TDBGrid).canvas.TextOut(Rect.Left + x,Rect.top,Column.Field.asstring);
        end;
end;

EDITO : modificacion para el justify y el selected, y el activerecord por el RecNo

Última edición por coso fecha: 11-08-2008 a las 16:14:56.
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Pintar filas del TstringGrid Gagiel Varios 2 16-03-2007 10:46:59
problemas al pintar filas con cxGrid v5 DANY OOP 1 29-11-2006 03:02:14
Pintar filas de un Listview Coco_jac Varios 4 14-07-2006 15:46:18
Pintar filas DbGrid lunatiko Varios 5 05-07-2005 15:11:51
pintar filas de un dbgrid febito Varios 1 01-04-2004 16:50:20


La franja horaria es GMT +2. Ahora son las 04:39:35.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi