| /* * No further full-erasing is required, * to prevent screen flashing caused by background erase and view repaint. * Only erase the blank area. */ BOOL CExListCtrl::OnEraseBkgnd(CDC* pDC) { //compute the holding-data-items area of this list control CRect rect; CPoint dataRgnTopLeftPoint; CPoint dataRgnBottomRightPoint; GetItemPosition(0 , &dataRgnTopLeftPoint); GetItemPosition(GetItemCount() , &dataRgnBottomRightPoint); if(!GetHeaderCtrl()->GetItemRect(GetHeaderCtrl()->GetItemCount()-1, rect)) return CListCtrl::OnEraseBkgnd(pDC); dataRgnBottomRightPoint.x = rect.right; rect.SetRect(dataRgnTopLeftPoint, (CPoint)(dataRgnBottomRightPoint - CPoint(2,2))); ClientToScreen(dataRgnRect); //compute and erase the blank area. Using the Marco. ERASE_BKGND_BEGIN; ADD_NOERASE_RECT(dataRgnRect); ERASE_BKGND_END(pDC, GetBkColor()); return false; } |
【中国下载站】【设为主页】【收藏本页】【打印本文】【回到顶部】【关闭此页】