Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Treeview question 1

Status
Not open for further replies.

KreativeKai

Programmer
Nov 12, 2004
33
0
0
US
This might be a simple question, but I can't seem to find an answer...

I have a tree view with several parent nodes and three child nodes under the last parent.

For all the parents I can change the individual forecolor using the following:
.Nodes(1).ForeColor = System.Drawing.Color.Black

How do you change a child node?
 
You need to iterate through the children of the parent, e.g.

Code:
dim n as node
for each n in me.TreeView1.Nodes(1).Nodes
    n.backcolor ...
next 'n

"I swear by my life and my love of it that I will never live for the sake of another man, nor ask another man to live for mine."
— John Galt
Atlas Shrugged

If you want to get the best response to a question, please check out FAQ222-2244 first

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top