Results 1 to 2 of 2

Thread: basic treeview question

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,091
    I'm trying to populate a treeview with the following method but it doesn't show the child node.. It shows the line going to where the child should be but no text appears.. What the heck am I doing wrong?

    Code:
        '-- initialize treeview
        TreeView1.Nodes.Add , , "Test", "Test"
        TreeView1.Nodes.Add "Test", tvwChild, "Test Child"
    Any help would be appreciated..

    Dan

  2. #2
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877
    Hi,
    You are not seeing any text because didnt ask it to show any text. for the second node you forgot to specify any text.


    Here is the modified code

    Code:
    Private Sub Form_Load()
        With TreeView1
            .Style = tvwTreelinesPlusMinusText
            .Nodes.Add , , "TheKey", "The Text"
            .Nodes.Add "TheKey", tvwChild, "TheKey2", "More Text"
        
            For i = 1 To .Nodes.Count   'expand the whole tree
                .Nodes(i).Selected = True
            Next
        End With
    End Sub
    Hope this helps
    Danial
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

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