CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 1999
    Location
    Australia
    Posts
    39

    treeview....need help!!

    Hi,
    I have a treeview and a textbox so whatever is the selected item in the treeview is displayed in the textbox. But it skips a selected item ad shows the next one in the textbox. It shows every alternate selected item.How do i get rid of this.
    My next problem is that i cannot assign an image to the treeview nodes even after choosing an image list and mentioning the tag/key in the treeview code.........

    Dim oNode as node
    Set oNode=treeview1.nodes.add(, , "Name","Something","ImgName",TagName)

    Is this right? And if it is wrong then can someone please tell me how to assign an image to the treeview nodes. Thanks in advance,
    Derek


  2. #2
    Join Date
    Feb 2000
    Location
    Ireland
    Posts
    808

    Re: treeview....need help!!

    For the part about images instead of using the imgname
    Dim oNode as node
    set oNode=treeview1.nodes.add(, , "Name","Something","ImgName",TagName)



    use the number of the image ie.

    Dim oNode as node
    set oNode=treeview1.nodes.add(, , "Name","Something",1,TagName)



    Hope this helps
    Tony.



  3. #3
    Join Date
    Jul 1999
    Location
    Australia
    Posts
    39

    Re: treeview....need help!!

    Hi,
    When i use this i get an error saying that the imagelist must be initialised.
    Derek


  4. #4
    Join Date
    Feb 2000
    Location
    Ireland
    Posts
    808

    Re: treeview....need help!!

    There is an imagelist property for the treeview control. Set this it be whatever iamgelist you want.


  5. #5
    Join Date
    Jul 1999
    Location
    Australia
    Posts
    39

    Re: treeview....need help!!

    Thanks alot TH1 for the help. It worked
    Derek


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

Featured