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
 
Back
Top