void CXXXComboBox::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
CDC* pDC = CDC::FromHandle(lpDrawItemStruct->hDC); pDC->SetBkMode( TRANSPARENT ); if (lpDrawItemStruct->itemState & ODS_SELECTED)
{
pDC->FillSolidRect (&lpDrawItemStruct->rcItem,theSkin.m_clrToolTipBackground);
pDC->SetTextColor (theSkin.m_clrToolTipText);
}
else
{
pDC->FillSolidRect (&lpDrawItemStruct->rcItem,theSkin.m_clrHearderCtrlBackground);
pDC->SetTextColor (theSkin.m_clrBannerStaticNewsText);
} if ((int)(lpDrawItemStruct->itemID) >=0)
{
CString strText;
GetLBText (lpDrawItemStruct->itemID,strText);
//为什么strText是乱码? CFont *pOldFont = pDC->SelectObject (&theSkin.m_font);
pDC->DrawText(strText,&lpDrawItemStruct->rcItem, DT_LEFT |DT_END_ELLIPSIS| DT_VCENTER | DT_SINGLELINE);
pDC->SelectObject (pOldFont);
}
}
{
CDC* pDC = CDC::FromHandle(lpDrawItemStruct->hDC); pDC->SetBkMode( TRANSPARENT ); if (lpDrawItemStruct->itemState & ODS_SELECTED)
{
pDC->FillSolidRect (&lpDrawItemStruct->rcItem,theSkin.m_clrToolTipBackground);
pDC->SetTextColor (theSkin.m_clrToolTipText);
}
else
{
pDC->FillSolidRect (&lpDrawItemStruct->rcItem,theSkin.m_clrHearderCtrlBackground);
pDC->SetTextColor (theSkin.m_clrBannerStaticNewsText);
} if ((int)(lpDrawItemStruct->itemID) >=0)
{
CString strText;
GetLBText (lpDrawItemStruct->itemID,strText);
//为什么strText是乱码? CFont *pOldFont = pDC->SelectObject (&theSkin.m_font);
pDC->DrawText(strText,&lpDrawItemStruct->rcItem, DT_LEFT |DT_END_ELLIPSIS| DT_VCENTER | DT_SINGLELINE);
pDC->SelectObject (pOldFont);
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货