CTreeCtrl labels - are painted with black background instead of trasparent Help needed plz
-
hi I implimented CustomDraw when i put lptvcd->clrTextBk = CLR_NONE ; lables are painted with black color background but not trasparent please some one tell me what shud i change in the code to get the CtreeCtrl lables trasparent void CLeftPaneTreeCtrl::OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult) { switch(pNMHDR->code) { case NM_CUSTOMDRAW: { LPNMTVCUSTOMDRAW lptvcd = (LPNMTVCUSTOMDRAW )pNMHDR; lptvcd->clrTextBk = CLR_NONE ; lptvcd->clrText = (RGB(0,0,255)); //SetTextColor(RGB(255, 0, 0)); //SetBkMode(lplvcd->nmcd.hdc,TRANSPARENT); switch (lplvcd->nmcd.dwDrawStage) { case CDDS_PREPAINT: // Need to process this case and set pResult to // CDRF_NOTIFYITEMDRAW, otherwise parent will never receive //CDDS_ITEMPREPAINT notification. (GGH) *pResult = CDRF_NOTIFYITEMDRAW; return; } } } }
-
hi I implimented CustomDraw when i put lptvcd->clrTextBk = CLR_NONE ; lables are painted with black color background but not trasparent please some one tell me what shud i change in the code to get the CtreeCtrl lables trasparent void CLeftPaneTreeCtrl::OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult) { switch(pNMHDR->code) { case NM_CUSTOMDRAW: { LPNMTVCUSTOMDRAW lptvcd = (LPNMTVCUSTOMDRAW )pNMHDR; lptvcd->clrTextBk = CLR_NONE ; lptvcd->clrText = (RGB(0,0,255)); //SetTextColor(RGB(255, 0, 0)); //SetBkMode(lplvcd->nmcd.hdc,TRANSPARENT); switch (lplvcd->nmcd.dwDrawStage) { case CDDS_PREPAINT: // Need to process this case and set pResult to // CDRF_NOTIFYITEMDRAW, otherwise parent will never receive //CDDS_ITEMPREPAINT notification. (GGH) *pResult = CDRF_NOTIFYITEMDRAW; return; } } } }
-
What happens if // lptvcd->clrTextBk = CLR_NONE ; dont get to work?
Greetings from Germany
Hi Karstenk Thanx for the reply if i coment out that line it will paint white background but i painted gradient color on CTreeCtrl backgoud so it doest help me and one more thing lplvcd->clrTextBk = CLR_NONE ; works fine with CListCtrl lables but same thing doesnt work for CTreeCtrl lables and any other color other than trasparent will take effect properly -SetBkMode(hdc,TRASPARENT) also wont work - it doesnt take any effect
-
hi I implimented CustomDraw when i put lptvcd->clrTextBk = CLR_NONE ; lables are painted with black color background but not trasparent please some one tell me what shud i change in the code to get the CtreeCtrl lables trasparent void CLeftPaneTreeCtrl::OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult) { switch(pNMHDR->code) { case NM_CUSTOMDRAW: { LPNMTVCUSTOMDRAW lptvcd = (LPNMTVCUSTOMDRAW )pNMHDR; lptvcd->clrTextBk = CLR_NONE ; lptvcd->clrText = (RGB(0,0,255)); //SetTextColor(RGB(255, 0, 0)); //SetBkMode(lplvcd->nmcd.hdc,TRANSPARENT); switch (lplvcd->nmcd.dwDrawStage) { case CDDS_PREPAINT: // Need to process this case and set pResult to // CDRF_NOTIFYITEMDRAW, otherwise parent will never receive //CDDS_ITEMPREPAINT notification. (GGH) *pResult = CDRF_NOTIFYITEMDRAW; return; } } } }
-
how to do that can u please give me some pointers how to start drawing the lables and where in customdraw?