Hi Everybody !
I have a tree control and I catch Custom Draw messages.
LRESULT CTreeListBox::OnCustomDraw(int idCtrl, LPNMHDR pnmh, BOOL& bHandled)
{
switch (pCustomDraw->nmcd.dwDrawStage)
{
case CDDS_PREPAINT:
CDC dc;
dc.Attach(pCustomDraw->nmcd.hdc);
dc.FillRect(&rcClient,&backcolor_brush);
return CDRF_NOTIFYITEMDRAW;
case CDDS_ITEMPREPAINT:
return CDRF_SKIPDEFAULT;
}
return 0;
}
I'm doing FillRect and paiting the whole client area when I get the Prepaint notification.
But I have a problem.
It seems like the Client area is erased on each cycle of Custom Draw messages.
(and then painted again with the FillRect call).
My questions is:
How can I get the CDDS_PREERASE notification ?
and more important
How can I avoid the erase cycle every times I refresh the Tree Control ,
so that i wouldnt have to fillrect again and again ?
I want to avoid the erasing of the backcolor of my control.
Thanks for any help.
Ron
I have a tree control and I catch Custom Draw messages.
LRESULT CTreeListBox::OnCustomDraw(int idCtrl, LPNMHDR pnmh, BOOL& bHandled)
{
switch (pCustomDraw->nmcd.dwDrawStage)
{
case CDDS_PREPAINT:
CDC dc;
dc.Attach(pCustomDraw->nmcd.hdc);
dc.FillRect(&rcClient,&backcolor_brush);
return CDRF_NOTIFYITEMDRAW;
case CDDS_ITEMPREPAINT:
return CDRF_SKIPDEFAULT;
}
return 0;
}
I'm doing FillRect and paiting the whole client area when I get the Prepaint notification.
But I have a problem.
It seems like the Client area is erased on each cycle of Custom Draw messages.
(and then painted again with the FillRect call).
My questions is:
How can I get the CDDS_PREERASE notification ?
and more important
How can I avoid the erase cycle every times I refresh the Tree Control ,
so that i wouldnt have to fillrect again and again ?
I want to avoid the erasing of the backcolor of my control.
Thanks for any help.
Ron