Look on below code:
void CColoredListReport::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
CDC* pDC;
pDC = CDC::FromHandle(lpDrawItemStruct->hDC);
switch (lpDrawItemStruct->itemAction) {
case ODA_DRAWENTIRE:
CRect cRect(lpDrawItemStruct->rcItem);
pDC->MoveTo(cRect.left, cRect.bottom);
pDC->LineTo(cRect.right, cRect.bottom);
pDC->LineTo(cRect.right, cRect.top-1);
CRect cSubItemRect;
GetSubItemRect(lpDrawItemStruct->itemID, 0, LVIR_LABEL, cSubItemRect);
pDC->DrawText(GetItemText(lpDrawItemStruct->itemID, 0), cSubItemRect, DT_LEFT);
GetSubItemRect(lpDrawItemStruct->itemID, 1, LVIR_LABEL, cSubItemRect);
pDC->MoveTo(cSubItemRect.TopLeft());
pDC->LineTo(cSubItemRect.left, cSubItemRect.bottom);
pDC->DrawText(GetItemText(lpDrawItemStruct->itemID, 1), cSubItemRect, DT_CENTER|DT_VCENTER);
GetSubItemRect(lpDrawItemStruct->itemID, 2, LVIR_LABEL, cSubItemRect);
pDC->MoveTo(cSubItemRect.TopLeft());
pDC->LineTo(cSubItemRect.left, cSubItemRect.bottom);
pDC->DrawText(GetItemText(lpDrawItemStruct->itemID, 2), cSubItemRect, DT_CENTER|DT_VCENTER);
GetSubItemRect(lpDrawItemStruct->itemID, 3, LVIR_LABEL, cSubItemRect);
pDC->MoveTo(cSubItemRect.TopLeft());
pDC->LineTo(cSubItemRect.left, cSubItemRect.bottom);
pDC->DrawText(GetItemText(lpDrawItemStruct->itemID, 3), cSubItemRect, DT_LEFT);
break;
}
}
In my whole code, i am using fillsolidrect() only with Erasebkground.
By using which method we can avoid this blurring?