Solved

Icons in TreeView

Posted on 2002-04-10
2
671 Views
Last Modified: 2013-12-03
My TreView shows icons with black background.
I made background transparent, it looks transparent in Windows Explorer and I want it to be transparent in my TreeView. This is the code:

  g_himl = ImageList_Create(16, 16, ILC_COLOR4, 1, 1);
  hicon = LoadIcon(g_hInst, MAKEINTRESOURCE(ICO_MyComp));
  iMyComp = ImageList_AddIcon(g_himl, hicon);
  DeleteObject(hicon);
  TreeView_SetImageList(g_hwndTree, g_himl, VSIL_NORMAL);
0
Comment
Question by:shvetsov
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 6933036
U have to specify ILC_COLOR'X' depending on the no. of colors used in the icon.

If 256 color icon is used, u have to specify ILC_COLOR8

if 16 color icon - ILC_COLOR4 can use


One mistake is also in the code - that compliling error

"TreeView_SetImageList(g_hwndTree, g_himl, VSIL_NORMAL)"

correct is
TreeView_SetImageList(g_hwndTree, g_himl, TVSIL_NORMAL)

GOOD LUCK


0
 
LVL 10

Accepted Solution

by:
makerp earned 100 total points
ID: 6941297
image_list.Create(13,13,ILC_COLOR4|ILC_MASK,3,1);
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question