Changing font color in tree

I have a winform treeview with several treenodes.  In some of the nodes, I want to change the displayed text so that some words are black and others are gray.  Is there a way to apply multiple colors to a single node's text?
Who is Participating?
Fahad MukhtarConnect With a Mentor Distinguished EngineerCommented:
sorry to misunderstood your question..

i think its not possible with the .net treeview control .. you have to write your own control and provide the feature.
Fahad MukhtarDistinguished EngineerCommented:
Use the BackColor, ForeColor and NodeFont Properties

treeView1.Nodes[0].ForeColor = Color.Gray;
treeView1.Nodes[1].ForeColor = Color.Blue;
treeView1.Nodes[2].NodeFont = new Font("Verdana", 10);
brettrAuthor Commented:
That seems to apply a single color to a single node.
brettrAuthor Commented:
I'm not sure how that would work either as you are still dealing with the same basic problem.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.