I used a class which derives from CListBox, and create it with following style:WS_CHILD|WS_VISIBLE |LBS_OWNERDRAWFIXED | WS_VSCROLL | WS_HSCROLL
I expect the ListBox's item to be have a fixed size, not affected by the size of the list box. So I override the MeasureItem() method, in which I specify the item's size like below:
void CMyListBox::MeasureItem(LPMEASUREITEMSTRUCT lpMIS) { lpMIS->itemHeight = ALBUM_ITEM_HEIGHT; lpMIS->itemWidth = ALBUM_ITEM_WIDTH; }
But the item's size changes according to the List box's size changing. is there anything wrong with my approach? Thank you!