Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CTreeCtrl lables help please

CTreeCtrl lables help please

Scheduled Pinned Locked Moved C / C++ / MFC
dotnethelpquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sarat
    wrote on last edited by
    #1

    why the bellow code doesnt make CTreeCtrl lables trasparent? the same method works fine for CListCtrl SetBkMode() also if i uncomment it doesnt make lables trasparent lables r painted with black color background instead of trasparent butif i use any other color other than CLR_NONE or TRASPARENT .. it will paint with the color i used properly but doesnt work with trasparent. help me plz please some one give me solution void CLeftPaneTreeCtrl::OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult) { switch(pNMHDR->code) { case NM_CUSTOMDRAW: { LPNMTVCUSTOMDRAW lplvcd = (LPNMTVCUSTOMDRAW)pNMHDR; //SetBkMode(lplvcd->nmcd.hdc,TRANSPARENT); lplvcd->clrTextBk = CLR_NONE; if(lplvcd->nmcd.dwDrawStage == CDDS_PREPAINT) { *pResult = CDRF_NOTIFYITEMDRAW; return ; } if(lplvcd->nmcd.dwDrawStage == CDDS_ITEMPREPAINT) { *pResult = CDRF_NOTIFYPOSTPAINT; return; } } } }

    I 1 Reply Last reply
    0
    • S sarat

      why the bellow code doesnt make CTreeCtrl lables trasparent? the same method works fine for CListCtrl SetBkMode() also if i uncomment it doesnt make lables trasparent lables r painted with black color background instead of trasparent butif i use any other color other than CLR_NONE or TRASPARENT .. it will paint with the color i used properly but doesnt work with trasparent. help me plz please some one give me solution void CLeftPaneTreeCtrl::OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult) { switch(pNMHDR->code) { case NM_CUSTOMDRAW: { LPNMTVCUSTOMDRAW lplvcd = (LPNMTVCUSTOMDRAW)pNMHDR; //SetBkMode(lplvcd->nmcd.hdc,TRANSPARENT); lplvcd->clrTextBk = CLR_NONE; if(lplvcd->nmcd.dwDrawStage == CDDS_PREPAINT) { *pResult = CDRF_NOTIFYITEMDRAW; return ; } if(lplvcd->nmcd.dwDrawStage == CDDS_ITEMPREPAINT) { *pResult = CDRF_NOTIFYPOSTPAINT; return; } } } }

      I Offline
      I Offline
      Iain Clarke Warrior Programmer
      wrote on last edited by
      #2

      If you have a look through last week's postings on this forum, you will find a few questions about transparent tree controls, backgrounds and labels. You can ignore the questions by George_George, so that will save you 50% of the effort. (Just because he didn't ask it...) Iain.

      Iain Clarke appearing by Special Request of CPallini.

      C 1 Reply Last reply
      0
      • I Iain Clarke Warrior Programmer

        If you have a look through last week's postings on this forum, you will find a few questions about transparent tree controls, backgrounds and labels. You can ignore the questions by George_George, so that will save you 50% of the effort. (Just because he didn't ask it...) Iain.

        Iain Clarke appearing by Special Request of CPallini.

        C Offline
        C Offline
        Cedric Moonen
        wrote on last edited by
        #3

        Iain Clarke wrote:

        You can ignore the questions by George_George, so that will save you 50% of the effort.

        :laugh:

        Cédric Moonen Software developer
        Charting control [v1.2]

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups