开发者

TreeVIew icons not displaying in MMC Snap-in on Windows XP

开发者 https://www.devze.com 2023-04-10 06:00 出处:网络
We have developed a User Interface as an MMC snap-in but we’re having issues displaying icons inside a Treeview on Windows XP.

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 Wind开发者_如何转开发ows XP. We researched on the internet and received some pointers. , like these –

  1. http://www.pcreview.co.uk/forums/re-mmc-3-0-and-xp-icons-t2611897.html

    This suggest drawing a Bitmap using the ico file.

  2. 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.

  3. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号