lsit控件从绘
lsit控件自绘?
本帖最后由 VisualEleven 于 2012-11-22 13:23:25 编辑
却进不了这里CDDS_ITEMPREPAINT | CDDS_SUBITEM
请高手指点??????
------最佳解决方案--------------------
void CListCtrlCl::OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult)
{
NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>(pNMHDR);
// Take the default processing unless we set this to something else below.
*pResult = CDRF_DODEFAULT;
// First thing - check the draw stage. If it's the control's prepaint
本帖最后由 VisualEleven 于 2012-11-22 13:23:25 编辑
if (pLVCD->nmcd.dwDrawStage == CDDS_PREPAINT)我想在subitem中画个进度条,资源属性设置了owner draw fixed 属性, Style 设置了REPORT,
{
// 能进入这里 ////////////////////////////////////////
*pResult = CDRF_NOTIFYITEMDRAW;
}
else if (pLVCD->nmcd.dwDrawStage == CDDS_ITEMPREPAINT)
{
// 能进入这里 ////////////////////////////////////////
// This is the notification message for an item. We'll request
// notifications before each subitem's prepaint stage.
*pResult = CDRF_NOTIFYSUBITEMDRAW;
}
else if (pLVCD->nmcd.dwDrawStage == (CDDS_ITEMPREPAINT | CDDS_SUBITEM))
{
//////////////////////////////////// 不能进入这里, 这是为什么 ? /////////////
// This is the prepaint stage for a subitem. Here's where we set the
// item's text and background colors. Our return value will tell
// Windows to draw the subitem itself, but it will use the new colors
// we set here.
int nItem = static_cast<int> (pLVCD->nmcd.dwItemSpec);
int nSubItem = pLVCD->iSubItem;
XLISTCTRLDATA *pXLCD = (XLISTCTRLDATA *) pLVCD->nmcd.lItemlParam;
ASSERT(pXLCD);
COLORREF crText = m_crWindowText;
COLORREF crBkgnd = m_crWindow;
........................
}
却进不了这里CDDS_ITEMPREPAINT | CDDS_SUBITEM
请高手指点??????
------最佳解决方案--------------------
void CListCtrlCl::OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult)
{
NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>(pNMHDR);
// Take the default processing unless we set this to something else below.
*pResult = CDRF_DODEFAULT;
// First thing - check the draw stage. If it's the control's prepaint