Como coloco Canvas em Subitens de um TListView em vsReport?

Delphi

25/07/2006

estou tentando fazer isto no evento oncustomdraw de subitens, so nao consigo me referir ao texto de cada um deles, keria pegar o 1º digito da string e se for ´-´ pintar a cedula de vermelho c nao azul.
se aguem poder me ajudar nisso..


Nightshade

Nightshade

Curtidas 0

Respostas

Nightshade

Nightshade

25/07/2006

procedure TForm1.ListView1CustomDrawSubItem(Sender: TCustomListView;
Item: TListItem; SubItem: Integer; State: TCustomDrawState;
var DefaultDraw: Boolean);
begin
try
if SubItem = 0 then Exit;
if (Pos(´-´, Item.SubItems[SubItem - 1]) > 0) then
begin
ListView1.Canvas.Font.Color := clRed;
end
else
begin
ListView1.Canvas.Font.Color := clBlue;
end;
except

end;
end;


GOSTEI 0
POSTAR