Solved

Changing font color in tree

Posted on 2007-03-26
5
213 Views
Last Modified: 2012-05-05
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?
0
Comment
Question by:brettr
  • 2
  • 2
5 Comments
 
LVL 19

Expert Comment

by:Desp
ID: 18798124
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);
0
 

Author Comment

by:brettr
ID: 18799605
That seems to apply a single color to a single node.
0
 
LVL 19

Accepted Solution

by:
Desp earned 500 total points
ID: 18799860
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.
0
 

Author Comment

by:brettr
ID: 18809783
I'm not sure how that would work either as you are still dealing with the same basic problem.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question