Click to See Complete Forum and Search --> : Ownerdrawn Listbox with entries and variable height


Jörg Eckart
September 2nd, 1999, 09:27 AM
Hi,

I have a class derived from CListBox with overridden member functions CListBox::DrawItem and CListBox::MeasureItem. The listbox is created with the style LBS_OWNERDRAWVARIABLE. The function MeasureItem is called by the framework when items are inserted. But I have to recalculate the items height also if the listbox is resized. I have seen no possibility to do so. The function MeasureItem is never called, not even if a message like WM_WINDOWPOSCHANGED or WM_SIZE is sent. The only possibility to get the items recalculated is to remove them from the list with CListBox::ResetContent and insert them one by one.

Does anybody know how to get the framework to call CListBox::MeasureItem after the listbox is resized?

Thanx in advance, Jörg