Hi,
I change the font of tree items in CTreeCtrl with the following code:
void CTreeCtrlEx::OnNMCustomdraw(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMTVCUSTOMDRAW pNMCD = reinterpret_cast<LPNMTVCUSTOMDRAW>(pNMHDR);
*pResult = 0;
switch(pNMCD->nmcd.dwDrawStage)
{
case CDDS_PREPAINT:
*pResult = CDRF_NOTIFYITEMDRAW;
return;
case CDDS_ITEMPREPAINT:
{
CFont * pco_font = GetSomeFont();
::SelectObject(pNMCD->nmcd.hdc, pco_font->GetSafeHandle());
*pResult = CDRF_NEWFONT;
}
return;
}
}
However, the end of the text is being clipped in the items, apparently it is not being
adjusted to the length of the text with the new font.
what would be the remedy?