procedure TForm1.ListView1CustomDrawItem(Sender: TCustomListView;
Item: TListItem;
State: TCustomDrawState;
var DefaultDraw: Boolean);
var
cData: Integer;
cType: Byte;
begin
cData := Integer(Item.Data);
ExtractProductType(cData, cType);
with Sender.Canvasdo
Font.Color := defProductColors[cType];
DefaultDraw := True;
end;
procedure TForm1.ListView1CustomDrawSubItem(Sender: TCustomListView;
Item: TListItem;
SubItem: Integer;
State: TCustomDrawState;
var DefaultDraw: Boolean);
begin
with Sender.Canvasdo
if SubItem = 1 then
Brush.Color := clInfoBk
else
if SubItem = 2 then
Brush.Color := clSilver;
else
begin
Font.Color := clGray;
{
Brush.Color := clSilver;
}
end;
DefaultDraw := True;
end;