Solved

Changing font color in tree

Posted on 2007-03-26
5
215 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

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…
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Suggested Courses

739 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