tags:

views:

448

answers:

3

I want to change item's height and width according to a slider, but as far as I know, there's no measureitem method as CListBox. How can I fix this?

Thank you!

A: 

When I look up in MSDN, I found that CListCtrl has only GetItemRect() instead of SetItemRect(). Does it mean that I can't change an item's size in a ListCtrl?

+2  A: 

All items in CListCtrl have to have the same size. I believe you can use OnMeasureItem in the container that holds the CListCtrl, but it won't be called for each item, but only once for the entire control.

Gerald
A: 

The workaround is to attach an image list to the CListCtrl. The rows will then take on a height based on the height of the image list.

jussij