|
-
May 28th, 2002, 04:53 AM
#1
ListCtrl: Why is the image not displayed?
Hi
In my list control (report) I use an image list. It is 20 x 100 pixels (5 images). The image list works fine for the 1st col (iSubItem = 0).
But now I'd like to set one of the images for the 2nd col (iSubItem = 1). Therefore I use the LVIF_IMAGE flag and set the number of the image. Then I call SetItem() which is executed successfully. But the image isn't displayed.
What could be the reason? Any ideas?
The list control is a derieved class and is created dynamically. Every image works for the 1st col, none for the 2nd. There's just the empty cell.
Many thanks in advance!
Holi
-
May 28th, 2002, 05:02 AM
#2
For subitems use LVIF_STATE and LVIS_STATEIMAGEMASK mask
state
Indicates the item's state, state image, and overlay image. The stateMask member indicates the valid bits of this member.
Bits 0 through 7 of this member contain the item state flags. This can be one or more of the item state values.
Bits 8 through 11 of this member specify the one-based overlay image index. Both the full-sized icon image list and the small icon image list can have overlay images. The overlay image is superimposed over the item's icon image. If these bits are zero, the item has no overlay image. To isolate these bits, use the LVIS_OVERLAYMASK mask. To set the overlay image index in this member, you should use the INDEXTOOVERLAYMASK macro. The image list's overlay images are set with the ImageList_SetOverlayImage function.
Bits 12 through 15 of this member specify the state image index. The state image is displayed next to an item's icon to indicate an application-defined state. If these bits are zero, the item has no state image. To isolate these bits, use the LVIS_STATEIMAGEMASK mask. To set the state image index, use the INDEXTOSTATEIMAGEMASK macro. The state image index specifies the index of the image in the state image list that should be drawn.
-
May 28th, 2002, 06:00 AM
#3
to igbrus
I found out meanwhile what the error was: I had to set the LVS_EX_SUBITEMIMAGES style. Now it works. Unfortunately the SetItem() method returns successfully although this style isn't set... :-(
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|