example :在customDrawitem事件中自行判断并设置颜色!
procedure TForm1.TreeView1CustomDrawItem(Sender: TCustomTreeView;
Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
begin
if node.Text ='red' then
begin
sender.Canvas.brush.Color := clREd;
end;
if node.Text ='blue' then
begin
sender.canvas.brush.color := clblue;
end;
if node.text ='green' then
begin
sender.Canvas.brush.color := clgreen;
end;
end;