We have developed a User Interface as an MMC snap-in but we’re having issues displaying icons inside a Treeview on Windows XP.
Basically, icons (.ico) added to ImageLists of a TreeView are simply not visible on Windows XP. We researched on the internet and received some pointers. , like these –
http://www.pcreview.co.uk/forums/re-mmc-3-0-and-xp-icons-t2611897.html
This suggest drawing a Bitmap using the ico file.
http://msdn.microsoft.com/en-us/library/aa965205(VS.85).aspx
This is an MSDN resource that suggests a few points to note in this regard.
http://msdn.microsoft.com/en-us/library/system.windows.forms.treeview.imagelist.aspx
This MSDN resource has a note that requires us to add Application.EnableVisualStyles()
and Application.DoEvents()
just before InitializeComponents()
- but since we are building an MMC snap-in, I cannot understand where to use these.
This link - http://msdn.microsoft.com/en-us/library/windows/desktop/bb773175(v=vs.85).aspx#mmc has some information about this but it is for VC++ whereas our entire code is in C#
Any clue?
This is a workaround - Populate the SmallImageList in the constructor and you should get this working.