Results 1 to 3 of 3

Thread: Problem with imageList and TreeView

  1. #1
    lavoyech is offline VB.NET Forum Newbie
    .NET Framework
    .NET 2.0
    Join Date
    Jun 2012
    Posts
    7
    Reputation
    0

    Problem with imageList and TreeView

    Hello,

    I'm using the ImageList property in a TreeView.

    Everything looks ok when i'm launching my application (good image for each kind of node).
    But when i select a node the image is changing by itself and i don't understand why...

    Does anybody have an idea to solve this problem?

    Best regards,
    Christophe.

  2. #2
    JohnH's Avatar
    JohnH is online now VB.NET Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Dec 2005
    Location
    Norway
    Posts
    14,225
    Reputation
    2370
    There is separate index/key for when node is selected, see TreeNode Properties (System.Windows.Forms)
    Both can be set using one of the constructors also, see TreeNode Constructor (System.Windows.Forms)
    or if you're using the collection.Add method: TreeNodeCollection.Add Method (System.Windows.Forms)

  3. #3
    lavoyech is offline VB.NET Forum Newbie
    .NET Framework
    .NET 2.0
    Join Date
    Jun 2012
    Posts
    7
    Reputation
    0
    thanks for your really fast help!
    i didn't use the correct overloading method to add a node.

    Have a nice day!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Harvest time tracking