Using the standard TListView component (ViewStyle = vsReport
), I have attached a TImageList and have successfully added images to both the first column (Item.ImageIndex := 0
) and to the subsequent columns (Items[0].SubItemImages[1] := 1
).
If I then set the CheckBoxes property to True, the images on SubItems disappear. The main image remains (the one set by Item.ImageIndex
) but the SubItems lose their images.
I have also noticed that the OnGetSubItemImage
event doesn't fire when CheckBoxes = True
Does anyone know of a way around this?
Best Answer
this is a very old bug, when you activate the CheckBoxes property would disable the LVS_EX_SUBITEMIMAGES and LVS_EX_INFOTIP styles on the TListView control.
you can use this workaround for fix this bug.
1) Disable the checkbox property in the listview
2) Put this code (Tested in Delphi 7 and windows 7) in your form .
3) and the final result is