none
Multiple images on a TreeNode in a TreeView control RRS feed

  • Question

  • Hello,
    Is it possible to have more than one image on a tree node in a TreeView control? I need to display status of items in the tree and that would be the best way of showing it. I can't find any samples on this.
    Thanks!
    Amit

    Tuesday, August 2, 2005 4:55 AM

Answers

  • It's not possible to display multiple images on a tree node in a TreeView control. The TreeView control is simply a thin wrapper around the TreeView Windows Common Control. So funcationality is somewhat limited. (That's why you give it an image list and an index offset. That's what the underlying common control uses.) You can't do funky things like drawing new images on the fly. Your best bet would be to find a third-party control that provides the required functionality.
    Tuesday, August 2, 2005 6:13 AM
  • Note that in Visual Studio 2005 we have added support for state images (which always existed in the ComCtl TreeView that is provided by the operating system). StateImages is an additional image that you can put along side (to the left) of a TreeNode's standard Image. Using a StateImage you can effectively have two images for a treenode.

    -mark
    Program Manager
    Microsoft
    This post is provided "as-is"

    Tuesday, August 2, 2005 6:18 PM

All replies

  • It's not possible to display multiple images on a tree node in a TreeView control. The TreeView control is simply a thin wrapper around the TreeView Windows Common Control. So funcationality is somewhat limited. (That's why you give it an image list and an index offset. That's what the underlying common control uses.) You can't do funky things like drawing new images on the fly. Your best bet would be to find a third-party control that provides the required functionality.
    Tuesday, August 2, 2005 6:13 AM
  • Note that in Visual Studio 2005 we have added support for state images (which always existed in the ComCtl TreeView that is provided by the operating system). StateImages is an additional image that you can put along side (to the left) of a TreeNode's standard Image. Using a StateImage you can effectively have two images for a treenode.

    -mark
    Program Manager
    Microsoft
    This post is provided "as-is"

    Tuesday, August 2, 2005 6:18 PM
  • I could really use that right now! I can't even set a different font color for different tree nodes, so I guess my only option at this point is to find a 3rd party control.
    Tuesday, August 2, 2005 7:32 PM
  • Is there a way to force the TreeNode to display its state image on the RIGHT side of the Node image ?
    Tuesday, February 21, 2006 7:46 PM