16,548
社区成员




if(lpDrawItemStruct->CtlType!=ODT_COMBOBOX)
return;
if(lpDrawItemStruct->itemID <0)
return;
CString strText;
GetLBText(lpDrawItemStruct->itemID,strText);
CRect ItemRC = lpDrawItemStruct->rcItem;
CDC* pDC = CDC::FromHandle(lpDrawItemStruct->hDC);
BOOL select = lpDrawItemStruct->itemState && ODS_SELECTED;
BOOL focus = lpDrawItemStruct->itemState && ODS_FOCUS;
COLORREF cnormal = GetSysColor(COLOR_WINDOW);
COLORREF cselect = GetSysColor(COLOR_HIGHLIGHT);
if(select)
{
pDC->SetBkColor(cselect);
pDC->FillSolidRect(&ItemRC,cselect);
}
else
{
pDC->SetBkColor(cnormal);
pDC->FillSolidRect(&ItemRC,cnormal);
}
if(focus)
pDC->DrawFocusRect(&ItemRC);
pDC->SetBkMode(TRANSPARENT);
pDC->SetTextColor(RGB(255,0,0));
pDC->TextOut(0,0,strText);