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. Coloring text of a checkbox

Coloring text of a checkbox

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
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.
  • T Offline
    T Offline
    Tommy2k
    wrote on last edited by
    #1

    How can this be done? I know how to change its background color but the text I can't get right...

    RaviBeeR 7 2 Replies Last reply
    0
    • T Tommy2k

      How can this be done? I know how to change its background color but the text I can't get right...

      RaviBeeR Offline
      RaviBeeR Offline
      RaviBee
      wrote on last edited by
      #2

      This is one of the features I plan to add to FooButton[^]. Will let you know when the article is updated. Meanwhile, you might want to check out (pun intended) some of the other owner drawn buttons here[^]. /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com

      1 Reply Last reply
      0
      • T Tommy2k

        How can this be done? I know how to change its background color but the text I can't get right...

        7 Offline
        7 Offline
        7stud
        wrote on last edited by
        #3

        Hi, I'm a beginner but I tried to figure it out for you. The following code doesn't work, but it's what I came up with, and maybe it will give you some ideas. I have a simple dialog box with a few controls and I added this function to the Dialog class(CCodeProject_Dialog2Dlg): HBRUSH CCodeProject_Dialog2Dlg::OnCtlColor(CDC *pDC, CWnd *pWnd, UINT nCtlColor) { HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor); if(pWnd->GetDlgCtrlID() == IDC_WIN98) { pDC->SetTextColor(RGB(255,0,0)); pDC->SetBkMode(TRANSPARENT); } return hbr; } How did you set the background color? I can't believe the previous poster wouldn't help you. I clicked on the link he posted, and any of the author's of those button programs should be able to tell you how to do that. Also, what's up with a programming forum that doesn't allow you to post indented code?

        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