Solved

Icons in TreeView

Posted on 2002-04-10
2
657 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
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now