Solved

Changing font color in tree

Posted on 2007-03-26
5
214 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How can i use linq for parsing string datetime to real datetime? 16 51
Add different cell to otherwise similiar row 4 46
.NET 2008 VB and C# 6 39
Why use this lambda? 12 40
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
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…

820 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