Results 1 to 2 of 2

Thread: Treeview - Really Important

  1. #1

    Thread Starter
    Hyperactive Member Asaf_99's Avatar
    Join Date
    Jul 2000
    Location
    Israel
    Posts
    335

    Question

    How do I use TreeView?

    Add nodes and sub-nodes and sub-sub-nodes etc. in Run time and in Design time?

    This is pretty hard.

    ThanX in advance.
    Asaf Sagi

    ICQ: 61917199
    E-Mail: [email protected]

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    To add a top-level node:
    Code:
    Dim nd as Node
    Set nd = tv.Nodes.Add(, , "Key", "Text", ImageListIndex, ImageListIndex_Selected)
    Where ImageListIndex and ImageListIndex_Selected are the indices of images in an ImageList control, that is bound at design time using the "Custom" property.

    To add subnodes, simply set them as child:
    Code:
    Dim ndx as Node
    Set ndx = tv.Nodes.Add(nd, tvwChild, "ChildKey", "My child's Text", img_idx, smallimg_idx)
    Hope this helps.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

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