默认的CListView的网格通过SetExtendedListViewStyle来实现
DWORD styles = listCtrl.GetExtendedStyle();
listCtrl.SetExtendedStyle(styles | LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES);
但颜色是灰色的,能否改变这个颜色??
高手指点!!
DWORD styles = listCtrl.GetExtendedStyle();
listCtrl.SetExtendedStyle(styles | LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES);
但颜色是灰色的,能否改变这个颜色??
高手指点!!
pmyListCtrl->GetExtendedStyle()|LVS_EX_HEADERDRAGDROP
http://www.codeproject.com/listctrl/skinlist.asp
http://www.codeproject.com/listctrl/ReportControl.asp
{
LPNMLVCUSTOMDRAW pDraw = (LPNMLVCUSTOMDRAW)pNMHDR; // Determine the drawing stage.
DWORD dwDrawStage = pDraw->nmcd.dwDrawStage;
*pResult = CDRF_NOTIFYITEMDRAW|CDRF_NOTIFYPOSTPAINT|CDRF_NOTIFYPOSTERASE; if(dwDrawStage & CDDS_ITEM)
{
//CSubDate* pHotel = (CSubDate*)pDraw->nmcd.lItemlParam;
if((dwDrawStage & CDDS_SUBITEM)&&(pDraw->iSubItem == 1))
{
pDraw->clrText = 0x0000FF;//RGB(88,33,255);
pDraw->clrTextBk=0xFFFEEE;
SelectObject(pDraw->nmcd.hdc,
(HFONT)m_Font1.m_hObject);
*pResult |= CDRF_NEWFONT;
}
else if((dwDrawStage & CDDS_SUBITEM)
&& (pDraw->iSubItem <= 2))
{
pDraw->clrText = 0xDF16EF;//RGB(200,100,40);
pDraw->clrTextBk=0xE8FDF9;
SelectObject(pDraw->nmcd.hdc,
(HFONT)m_Font3.m_hObject);
*pResult |= CDRF_NEWFONT;
}else{
pDraw->clrText = 0x8888FF;//RGB(200,100,40);
pDraw->clrTextBk=0xE8FDF9;
SelectObject(pDraw->nmcd.hdc,
(HFONT)m_Font1.m_hObject);
*pResult |= CDRF_NEWFONT;
}
}
}
重新绘制