Solved

Changing font color in tree

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

705 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now