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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.