Owner Draw CListCtrl changing fonts
Posted on 1997-02-23
I wanted to have a CListCtrl that can display items in multiple colors, so I thought I would make it Owner-Draw.
It works fine when it uses the default font it was created with, but if it is changed to a larger font using SetFont() the rcItem member of the DRAWITEMSTRUCT passed to CListCtrl::Drawitem() has the wrong coordinates in it. It seems that the rcItem contains the rectangle for the item if it were drawn with the original (small ) font.
If the listctrl is not owner draw calling Setfont() works okay..
How can I make an owner-draw list control change font correctly? Also, how do I stop garbage pixels appearing when I resize the columns (ie: when a column is enlarged, pixels from the column boundary appear on the border of the column to the right, and remain until the row is redrawn by selecting it with the mouse)