procedure TMainForm.TreeView1CustomDrawItem(Sender: TCustomTreeView;
Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
begin
if node.Selected then
begin
treeview1.Canvas.Font.Color:=clred
end
else
begin
treeview1.Canvas.Font.Color:=clblack;
end;
end;