Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
It seems that there is a limitation to 16 transparent icons you can use in a CComboBoxEx. I have the following pseudo code (I am adding the same icon but you get the idea):

C++
HICON hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME)
m_ImageList.Create(16,16,ILC_COLOR32,20,1);

for (int nImage = 0; nImage < 20; nImage++)
{
    m_ImageList.Add(hIcon);
}
m_cmbAction.SetImageList(&m_ImageList);

The first 16 icons are OK - the following ones all have a black background instead of the transparency. The same code with an Image list associated to a CTreeCtrl or a CListCtrl works beautifully. I know it sounds crazy but any ideas? Thanks in advance

I am using Visual Studio 2013, Windows 10.

What I have tried:

If you want to reproduce, you can download the code from here http://db.tt/ewe3wsQ7gQ

Adding ILC_MASK to the CImageList::Create does not help (and according to some sources should not be used with ILC_COLOR32)
Posted
Updated 6-Feb-17 2:16am

1 solution

This has been found by someone else but I give the reference for future reference: I was using CBEIF_OVERLAY for adding the items - and there is a limitation there!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900