Results 1 to 2 of 2

Thread: TreeView

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2000
    Location
    I'm right here!
    Posts
    849
    How do I use the TreeView control?
    Add nodes and writing there code?
    Dekel C.

  2. #2
    Addicted Member S@NSIS's Avatar
    Join Date
    Aug 2000
    Location
    Stoke-On-Trent, England
    Posts
    243
    Hi,
    This is how I do it!


    Code:
    Dim TVX as Node
    Dim tvNode as Nodes
    
    Set tvNode = TreeView1.Nodes
    
    'To add a root 
    Set TVX = tvNode.Add(, , "RootID", "RootText") 'Adds a root
    
    'To add a child to the root
    Set TVX = tvNode.Add("RootID", tvwChild, "ChildID","ChildName") 'Adds a child to root with corresponding rootID
    You can keep repeating this for as many sub-folders as you want. Just make sure that if you want something to be in a folder, that it's RootID is the same ID as the root that you want it to be under!


    Hope this helps

    Shaun

    Web/Application Developer
    VB6 Ent (SP5), Win 2000,SQL Server 2000

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