evc的联机帮助Microsoft Foundation Class Library for Windows CE.NET中
对CListBox的DrawItem的说明,说DrawItem 可以重写,如果重写了,请问,如何让系统调用自己重写的DrawItem函数。
msdn中,有段代码
// CMyListBox is my owner-drawn list box derived from CListBox. This
// example draws an item's text centered vertically and horizontally. The
// list box control was created with the following code:
// pmyListBox->Create(
// WS_CHILD|WS_VISIBLE|WS_BORDER|WS_HSCROLL|WS_VSCROLL|
// LBS_SORT|LBS_MULTIPLESEL,
// myRect, pParentWnd, 1);
//
An application can create an owner-drawn list box by specifying the LBS_OWNERDRAWFIXED or LBS_OWNERDRAWVARIABLE style.
可以看出应该为 List Box 设置其中一个属性。
The parent window or dialog box of an owner-drawn list box (its owner) receives WM_DRAWITEM messages when a portion of the list box needs to be painted.