<p>I used a class which derives from <code>CListBox</code>, and create it with following:</p>

<pre><code>style:WS_CHILD|WS_VISIBLE |LBS_OWNERDRAWFIXED | WS_VSCROLL | WS_HSCROLL
</code></pre>

<p>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:</p>

<pre><code>void CMyListBox::MeasureItem(LPMEASUREITEMSTRUCT lpMIS)
{
    lpMIS-&gt;itemHeight = ALBUM_ITEM_HEIGHT;
    lpMIS-&gt;itemWidth = ALBUM_ITEM_WIDTH;
}
</code></pre>

<p>But the item's size changes according to the List box's size changing. is there anything wrong with my approach?</p>

If you look at the
```
MSDN
```
entry for
```
CListBox::MeasureItem
```
you'll see that it's only called once unless the
```
LBS_OWNERDRAWVARIABLE
```
(not
```
LBS_OWNERDRAWFIXED
```
) style is set. If I understand correctly then this would explain the behaviour you're seeing because
```
MeasureItem
```
would need to be called each time the control's size changes.
Also, have you considered the points made in
MFC Technical Note 14 : Custom Controls
?