images in tab controls

I have added an image to a tab ctrl through an image map.  The image looks goofy though because it picks up the background color of the window, instead of just staying the color of the tab control.  Any suggestions?
pfauxAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Nicolay_ChConnect With a Mentor Commented:
Set image background color exactly color of window...

0
 
udiaCommented:
Nicolay is correct, you should set the image list bk color to be the system bk color.
This is the code which does this:

      m_ImageList.SetBkColor(GetSysColor(COLOR_WINDOW));
0
 
pfauxAuthor Commented:
this doesn't appear to work right...there is no change to the images background color, even when I change COLOR_WINDOW to COLOR_ACTIVEBORDER, etc.

I even tried setting this when we are adding the image list
m_smlImageList.Add( &m_SmallMap,
   GetSysColor(COLOR_WINDOW) );

and that just causes the background to be a pink color

any suggestions?
0
 
pfauxAuthor Commented:
figured it out, here is what I finally did, in the spot where I am inserting the image.

m_Tab.GetImageList()->
     SetBkColor(CLR_NONE);
ptr.iImage = 64;
m_Tab.SetItem(1,&ptr);

0
 
pfauxAuthor Commented:
i'll accept your answer because you are kind of correct.  I did need to set the background but needed to set it to none...so that it would be transparent.  Only found that because the other way did not work.  You did get me into the correct area in the documentation to find the right answer.
0
All Courses

From novice to tech pro — start learning today.