Im using Excel 2003 for a userform that has a MS TreeView (V6) on it. I want to color certain nodes to create differences between them.
I believe there is a Backcolor and Forecolor option but I can't get them to work on the nodes. All I get is a complete blackout of the node no matter what color I set.
Any clues would be great.
Here is some of my code so far as a reference -
I believe there is a Backcolor and Forecolor option but I can't get them to work on the nodes. All I get is a complete blackout of the node no matter what color I set.
Any clues would be great.
Here is some of my code so far as a reference -
Code:
Sub setup_tree()
Dim nodeitem As Node
'create tree levels
With UserForm1.TreeView1
.Nodes.Clear 'clear all previously loaded nodes
Set nodeitem = .Nodes.Add(, , "Top", "This is the top level") 'add the very top level
nodeitem.Expanded = True 'expand tree level
Set nodeitem = .Nodes.Add("Top", tvwChild, "Level 2", "Level 2") 'add child to top level
nodeitem.BackColor = red 'color node background in red (not working!!)
nodeitem.ForeColor = blue 'color node foreground in red (not working!!)
End With
'show form to user
Load UserForm1
UserForm1.Show
End Sub