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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change a node's text colr in a treeview?

Status
Not open for further replies.

RiceW

Programmer
Jan 31, 2003
8
US
How do you change the node's text colr in a treeview.
It is probably simple with an API, but I can't find it!


Thanks in advance.
 

I thought I answered something like this recently, but maybe not, well here goes. This is a modification of the example VB's help provides.
[tt]
Private Sub Form_Load()
Dim N As Node
Set N = TV.Nodes.Add(, , "R", "Root")
N.ForeColor = vbRed
Set N = TV.Nodes.Add("R", tvwChild, "C1", "Child 1")
N.ForeColor = vbBlue
Set N = TV.Nodes.Add("R", tvwChild, "C2", "Child 2")
N.ForeColor = vbYellow
Set N = TV.Nodes.Add("R", tvwChild, "C3", "Child 3")
N.ForeColor = vbGreen
Set N = TV.Nodes.Add("R", tvwChild, "C4", "Child 4")
N.EnsureVisible
TV.Style = tvwTreelinesText ' Style 4.
TV.BorderStyle = vbFixedSingle

End Sub
[/tt]

Good Luck

 
Well, that was painless. How dumb of me. Thank you!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top