Results 1 to 7 of 7

Thread: Treeview and SelectedImageIndex problem.

  1. #1

    Thread Starter
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Treeview and SelectedImageIndex problem.

    Since the starting index of an image list is 0 then for EVERY node I select at runtime changes the image to that of the image with index 0 in the imagelist.
    I don't want to have a seperate Selected Image. How do I turn this off?
    Do I have to specifically specify that the SelectedImageIndex is the same as the image I assign to the node?

    Woka

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Do you set images at runtime from imagelist ?

  3. #3

    Thread Starter
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632
    The images are loaded into the imagelist at DESIGN TIME...
    Then at runtime when I add nodes I give them an image. This works fine.
    But when I select ANY node it always changes the image to that of the image which has an index of 0 in the imagelist. When I select another node the image reverts back to the original.

    Woka

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    You should do this when you create your nodes . Set the image index to the second one for example and set the selected image as the same one you previously selected .
    VB Code:
    1. Dim nd As New TreeNode("Item2", 1, 1)

  5. #5

  6. #6

  7. #7

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