C#.Net TreeView question

  • Thread starter Thread starter Jason Huang
  • Start date Start date
J

Jason Huang

Hi,

In the C#.Net 2.0, in a TreeView, I have 3 childnodes, Node1, Node2, Node3.
What do I need to do so whenever I click Node1 the Node1's color will change
to grey?
Thanks for help.


Jason
 
Hi Jason,

Seems WinForms. Use NodeMouseClick event to get access to clicked node, then
use its properties for changing. In your case it's Node.BackColor = Color.Gray


Regards, Alex
[TechBlog] http://devkids.blogspot.com
 
Hi,

In the C#.Net 2.0, in a TreeView, I have 3 childnodes, Node1, Node2, Node3..
What do I need to do so whenever I click Node1 the Node1's color will change
to grey?
Thanks for help.

Jason


I think you can use the following in AfterSelect event of treeview.

treeView1.SelectedNode.ForeColor = Color.Red; //whatever the colors
you like
treeView1.SelectedNode.BackColor = Color.Gray; //whatever the colors
you like

-Cnu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

TreeView using 1
ArrayList.Sort not sorting properly 3
TreeView Question 4
Selecting a Node in a TreeNode from a TreeView 1
ThreeView 2
TreeView 4
Shredding XML & replacing sections.. 9
XElement questions 4

Back
Top