Icons in TreeView disappear in WinXP

I uses icons in a TreeView. When the program runs in Windows 2003, it looks fine; but the icons disappear when the same program runs in windows xp.

The program is built in Whidbey Beta2. In Beta1, this problem does not exist.



Answer this question

Icons in TreeView disappear in WinXP

  • Eligible

    Today, I remove the ImageList out of TreeView in designer and manually set the ImageList property of TreeView and found it still not work in WinXP.

    I embeded all icons as resources of my project, and load these resources in code, add them to a ImageList, and finally set this ImageList to TreeView. These icons appear in Win2003 normally, but in XP it just disappear.


  • Dave_MEC

    Please remove all images from your ImageList and then re-add them in Whidbey Beta2 and then compile your application. There are serialization differences between Beta1 and Beta2 so just a recompile won't solve this.

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


  • Kevin Harder

  • Shivu

    I did this just now. But still not work. Do I have to re-add the bmp files on a WinXP machine (I just did this on a Win2003 machine)

    Thanks!


  • Bill Henning

    Mark et. al.,

    I just posted a similar question in this forum, but I am using the shipping VSTO 2005, and the new VS, from my recent VS Pro 2005 purchase. I run XP Pro on a Toshiba duo-core.

    I wrote a trivial windows app in designer that puts up a form with one tree control and 2 baked-in nodes. They show my icons perfectly.

    Creating the same app, but as a VSTO Outlook Add-in, launching the form as the only code in the "app startup" function shows NO icons.

    The same .ico files from the same directory were loaded into a new imagelist the same way, in both cases.

    HELP! I really need these icons in my add in!

    -Allen



  • xjackphillips

    Thank you Mark,

    How can I open a bug I never did that before.

    Thanks!


  • babu mano

    Do you load the ImageList and associate the icons with the TreeView nodes in code or in the designer  

    If in the designer, have you tried reloading the ImageList and reassociating the icons

    If through code, are you loading using the icons in the load event (i.e., not in the constructor)

  • MarkLuo

    Did you get past this Im using VSTS release bits obviously at this point but Im having the same problem...

    works fine in 2003 wont show up in xp..


  • Rosanna

    BTW : these images are stored in a ImageList. This ImageList and TreeView are created in Whidbey Beta1. After we upgrade to Beta2, this problem occur.

    Thanks!


  • esjr

    If You have Application.EnableVisualStyles() in code remove it.
    It has helped me
    For more details look this: http://rungesrand.blogspot.com/2007/09/what-happened-to-treeview-icons.html

  • Toengel

    You shouldn't have to do that. Can you open a bug and include one of your images that is not working

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

  • Pini

    I load the ImageList in designer (in Whidbey Beta1) and have never modify it after that. Now I recompile the program in Whidbey Beta2 and the executable works fine in Win2003. However, if I put the same executable in WinXP, the icon will disappear.

    Should I reloading the ImageList and reassociating the icons Why the same executable behaves different in Win2003 and WinXP

    Thanks!



  • Icons in TreeView disappear in WinXP