Connecting Tech Pros Worldwide Forums | Help | Site Map

Bold rows using custom drawing

neo
Guest
 
Posts: n/a
#1: Oct 2 '06
I am working on vs2k5. I made MFC-SDI application and view class
inherited from CListView. I was tried a lot to bold one row in List
using custom drawing but I was able not understand, how to use custom
drawing.

I was changed text color of one row using custom drawing, and following
code written for NM_CUSTOMDRAW message

void CTestView::OnNMCustomdraw(NMHDR *pNMHDR, LRESULT *pResult)
{
*pResult = 0;
LPNMLVCUSTOMDRAW pNMCD = (LPNMLVCUSTOMDRAW)pNMHDR;
switch( pNMCD->nmcd.dwDrawStage )
{
case CDDS_PREPAINT:
{
*pResult = CDRF_NOTIFYITEMDRAW;
break;
}
case CDDS_ITEMPREPAINT:
{
*pResult = CDRF_DODEFAULT;
int iRow = pNMCD->nmcd.dwItemSpec;
pNMCD->iSubItem;
if(iRow == 0)
{
pNMCD->clrText = RGB(255, 0, 0);
*pResult = CDRF_NEWFONT;
}
break;
}
default:
*pResult = CDRF_DODEFAULT;
}
}

How Bold the rows using custom drawing? And is there any other way to
Bold Row using CListView?

Regards,
-aims


Closed Thread