Ver Mensaje Individual
  #2  
Antiguo 14-07-2005
iuqrul iuqrul is offline
Miembro
 
Registrado: dic 2004
Ubicación: Cartagena
Posts: 36
Reputación: 0
iuqrul Va por buen camino
Hola, create un formulario pon en él un ListView, el ListView.ViewStyle a vsReport y el ShowColumnHeaders a True y enganchale estos eventos, lo que he marcado en verde sería para pintar las columnas de forma independiente, si tienes más de dos columnas las siguientes te las dejará con el color de la 2.

procedure TForm1.ListView1CustomDrawSubItem(Sender: TCustomListView;
Item: TListItem; SubItem: Integer; State: TCustomDrawState;
var DefaultDraw: Boolean);
begin
with Sender.Canvas do begin
if subItem mod 2 = 0 then
Brush.Color := clyellow
else
Brush.Color := clRed;
{ case subitem of
1: Brush.Color := clyellow;
2: Brush.Color := clRed;
end}

end;
end;

procedure TForm1.ListView1CustomDraw(Sender: TCustomListView;
const ARect: TRect; var DefaultDraw: Boolean);
begin
Sender.Canvas.Brush.Color := clWhite;
Sender.Canvas.FillRect(ARect);
end;

procedure TForm1.ListView1CustomDrawItem(Sender: TCustomListView;
Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean);
begin
with Sender.Canvas do begin
Brush.Color := clBlue;
end
end;


Un saludo.
Responder Con Cita