I created an owner draw CListCtrl object (inside of another resizable
control).
CListCtrl::Create ( LVS_REPORT |
LVS_SINGLESEL |
LVS_OWNERDRAWFIXED |
WS_CHILD |
WS_VISIBLE |
WS_BORDER,
rect, pParentWnd, nID ) );
this->SetExtendedStyle ( LVS_EX_GRIDLINES );
Ive overload the DrawItem and MeasureItem methods as well. Ive overloaded
the WM_SIZE handler to fit all the columns on the control too.
When all the rows are displayed, everything works fine. When I have more
rows than can be displayed, and the control's (vertical) scrollbar appears, I
can happily scroll and select and identify and navigate to any row/column
that is visible. That all works fine as expected, however, if I (say) select
the last row, then increase the size of the control (vertically) to see all
the rows, some blank rows appear at the top of the control. The GetItem()
methods all work fine, I can still select and find any item, its just got
some rogue empty rows at the top. They will disappear if I shrink the control
back down, and select the top row.
Any suggestions ?