|
|
Jabaco Source |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
Private Sub FillTree With TVS For i = i To i + 3 .AddNode("Person " & CStr(i) & " (Pre, Sur)", "Person" & CStr(i)) .AddNode("Address", "Address" & CStr(i)) .AddLeaf("Sreet (Name, Nr)", "Sreet" & CStr(i)) .AddLeaf("City (PLZ/Zip, Name)", "City" & CStr(i)) .pop .AddNode("Phone", "Phone" & CStr(i)) .AddLeaf("Private (country, city, nr)", "PhonePrivate" & CStr(i)) .AddLeaf("Business (country, city, nr)", "PhoneBusiness" & CStr(i)) .AddLeaf("Mobile (country, net, nr)", "PhoneMobile" & CStr(i)) .pop .pop Next .Root.Expand = True End With End Sub |
|
|
Jabaco Source |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
Option Explicit Dim myRoot As Node Dim myTree As TreeView Public Sub TreeViewStack(aTree As TreeView) myTree = aTree End Sub Public Function AddNode(Text As String, Key As String) As Node AddNode = Cast(Base.push(AddLeaf(Text, Key)), Node) End Function Public Function AddLeaf(Text As String, Key As String) As Node If myRoot = Nothing Then Call Root Dim rnd As Node = Me.peek AddLeaf = myTree.Nodes.Add(rnd, tvwChild, Key, Text) End Function Public Function Root() As Node If myRoot = Nothing Then myRoot = Cast(Base.push(myTree.Nodes.Add(Nothing, tvwFirst, "Root", "")), Node) End If Root = myRoot End Function Public Function peek() As Node peek = Cast(Base.peek, Node) End Function Public Function pop() As Node pop = Cast(Base.pop, Node) End Function |
Also have a look at the small Jabaco-example attached. This post has been edited 1 times, last edit by "OlimilO" (Sep 19th 2009, 6:03pm)