Click here to Skip to main content
15,887,585 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to change the Click HightLight Color in the treeView,Just Like The Title . Thank You!
Posted

You'll have to draw it yourself. Here is what this MSDN page says about the topic:
You can customize most of the TreeView colors by setting color properties,
but the selection highlight color is not available as a property.
However, that page also shows you how to custom draw nodes yourself, and it even shows specifically how to change the color of the highlighted node. Note that my use of TreeView is very limited... I found this information with Google... Google is your friend. Not sure if you just got unlucky this time, but I suggest you Google a bit first before asking questions here. It only took me 5 minutes to find that information (actually, more like 30 seconds to find it and 5 minutes to review it). Imagine how much time you could save if you learn how to use Google.
 
Share this answer
 

You didn't mention if you want this for Winforms or for Webforms. If it is for web, you can use appropriate css to do this.

 Use
#a { color : red;}

You can also customize a:visited a:hover etc using css.


 
Share this answer
 
in webform, we can add TreeNode's client click event to change its color
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900