1. I've added 4 bitmaps to an image list. The 1st and 3rd represent the unselected state. The 2nd and 4th represent the selected state. The combo has style DROPLIST. When I mouse over each item, the previous state of an item is not changing. For example, mouse over item one and its state bitmap changes. Now, mouse over item two and its state image changes, but, item one's image remains as it was.
2. Is there any way to remove text from the display? Can I display only a bitmap, or, am I locked into a bitmap and text?
CComboBoxEx uses the COMBOBOXEXITEM structure to insert items. If you do not specify a value for pszText, you end up with something like "|" displayed where the text would normally display. For #2, I'd like to display the bitmap but not the text.
Yes that is true. My suggestion is that to try with DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) to draw the icons. I know that is not the best way but if you want that not display the text I think this is the only solution.
Please use code tags [code] [/code]
We would change the world, but God won't give us the sourcecode..
Undocumented futures are fun and useful....
_________
Gili
Yes, I already have such an implentation. I was hoping to replace it with some of the features of CComboBoxEx. But, it appears that it's too buggy right now to be useful.
tmecham: thanks for taking a look at this. I changed the code to use the same bitmap for the selected and unselected image. I can live wth that. However, I can't seem to get rid of the vertical bar when I don't specify text for each item. Take look at the attached bitmap.
When I change the size of my combo box, I guess I am seeing the same thing. It's just that my bitmaps are a little wider than my combo box, so I don't see the empty string being highlighted. So I guess one way to get around it would be to do what I did, and make your bitmaps wider using whitespace. Kind of stupid to have to do that, but I can confirm that it works ...
"Live only for tomorrow, and you will have a lot of empty yesterdays today."
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.