Hi Pete,
I hope this can get you started. The tricky part is that none of the
methods I show here show up in the dropdown for the treeview control. I
got a sample of treeview code from the internet somewhere. I
simplified it a bit to illustrate the relationship of the nodes.
This code assumes you have a treeview control on your form called
Treeview0
Private Sub Form_Load()
Me.TreeView0.Nodes.Clear
Me.TreeView0.LineStyle = tvwRootLines
Me.TreeView0.Indentation = 100
Me.TreeView0.Nodes.Add Key:="Main", Text:="myMain"
Me.TreeView0.Nodes.Add Relative:="Main", _
relationship:=tvwChild, Key:="Test", Text:="Test"
Me.TreeView0.Nodes.Add Relative:="Test", _
relationship:=tvwChild, Key:="Test1", Text:="myTest1"
Me.TreeView0.Nodes.Add Relative:="Test1", _
relationship:=tvwChild, Key:="Test1a", Text:="myTest1a"
Me.TreeView0.Nodes.Add Relative:="Test1", _
relationship:=tvwChild, Key:="Test1b", Text:="myTest1b"
Me.TreeView0.Nodes.Add Relative:="Test", _
relationship:=tvwChild, Key:="Test2", Text:="myTest2"
Me.TreeView0.Nodes.Add Relative:="Test", _
relationship:=tvwChild, Key:="Test3", Text:="myTest3"
End Sub
Note: tvwChild and tvwRootLines are constants that are part of the
Treeview control. There are more constants with specific names that are
part of the Treeview control. You can look these up on the internet.
There is a constant for adding images to the list
Me.TreeView0.Style = tvwTreelinesPlusMinusPictureText
Rich
*** Sent via Developersdex
http://www.developersdex.com ***