[C#]用Forms.TreeView显示Icon会有黑边

我想要用System.Windows.Forms.TreeView来显示文件系统树,就像资源管理器那样。文件和文件夹图标是通过SHGetFileInfo函数取得的,一切很顺利,但是显示的图标外围有一圈黑边,我确实已经将ImageList.TransparentColor属性设置成了Color.Black了,看起来似乎这个透明色设置没有生效。

解决方案:

ImageList.ColorDepth = ColorDepth.Depth32Bit

posted @ 2011-05-30 01:57  Scan.  阅读(668)  评论(0编辑  收藏  举报