Results 1 to 3 of 3

Thread: Multiple "Roots" in a treeview

  1. #1
    Guest

    Post

    Can someone please tell me how to have multiple "roots" in a treeview. I have seen this in other programs but can't figure out how to do it.

    I need a database where employees can add files to any of ten default categories or "roots" that cannot be changed or deleted by the employes.

    Please help if you can. I've been on vacation and am really behind in this project.

    Many thanks!

    Jaxon


  2. #2
    Member
    Join Date
    Jul 1999
    Posts
    42

    Post

    Sub SetUpTree()
    Dim mNode As Node

    tvwMain.Style = tvwTreelinesPlusMinusPictureText
    ' Root 1 & children
    Set mNode = tvwMain.Nodes.Add(, , "Root1", "Root1")
    Set mNode = tvwMain.Nodes.Add("Root1", tvwChild, "Child 1 1", "Child 1 1")
    Set mNode = tvwMain.Nodes.Add("Root1", tvwChild, "Child 1 2", "Child 1 2")
    Set mNode = tvwMain.Nodes.Add("Root1", tvwChild, "Child 1 3", "Child 1 3")
    ' Root 2 & children
    Set mNode = tvwMain.Nodes.Add(, , "Root2", "Root2")
    Set mNode = tvwMain.Nodes.Add("Root2", tvwChild, "Child 2 1", "Child 2 1")
    Set mNode = tvwMain.Nodes.Add("Root2", tvwChild, "Child 2 2", "Child 2 2")
    Set mNode = tvwMain.Nodes.Add("Root2", tvwChild, "Child 2 3", "Child 2 3")
    ' Root 3 & children
    Set mNode = tvwMain.Nodes.Add(, , "Root3", "Root3")
    Set mNode = tvwMain.Nodes.Add("Root3", tvwChild, "Child 3 1", "Child 3 1")
    Set mNode = tvwMain.Nodes.Add("Root3", tvwChild, "Child 3 2", "Child 3 2")
    Set mNode = tvwMain.Nodes.Add("Root3", tvwChild, "Child 3 3", "Child 3 3")

    End Sub

  3. #3
    Guest

    Post

    Alfred -

    Thanks for the code. I'll get to work on it
    Monday and let you know by email how I did with it. Thanks again. I'm learning more from you guys than from my teachers and many books!

    jaxon

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width