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. Radio button text color not set

Radio button text color not set

Scheduled Pinned Locked Moved C / C++ / MFC
c++
6 Posts 2 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.
  • M Offline
    M Offline
    MKC002
    wrote on last edited by
    #1

    I have dialog base MFC application Dialog box contains only one control(radio button) to change the text color of radio button i use oncltcolor(WM_CTLCOLOR) BUT it's now working i am using xp theme is there any solution

    L 1 Reply Last reply
    0
    • M MKC002

      I have dialog base MFC application Dialog box contains only one control(radio button) to change the text color of radio button i use oncltcolor(WM_CTLCOLOR) BUT it's now working i am using xp theme is there any solution

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      MKC002 wrote:

      BUT it's now working

      I assume that should read not working, in which case you need to give more detail, including a snippet of your code showing where it is going wrong.

      Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman

      M 1 Reply Last reply
      0
      • L Lost User

        MKC002 wrote:

        BUT it's now working

        I assume that should read not working, in which case you need to give more detail, including a snippet of your code showing where it is going wrong.

        Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman

        M Offline
        M Offline
        MKC002
        wrote on last edited by
        #3

        I have dialog base application, dialog box contains one radio button. to set the text color of radio button HBRUSH CtestDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { ...... // TODO: Change any attributes of the DC here if (pWnd->GetDlgCtrlID() == IDC_RADIO1) { pDC->SetTextColor (RGB(128,0,0)); // blue } ..... } This code works fine and radio button color gets changed but if i use xp theme in this project then text color of radio button does not set. To set xp theme, i add one custom resource which contains testdlg

        L 1 Reply Last reply
        0
        • M MKC002

          I have dialog base application, dialog box contains one radio button. to set the text color of radio button HBRUSH CtestDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { ...... // TODO: Change any attributes of the DC here if (pWnd->GetDlgCtrlID() == IDC_RADIO1) { pDC->SetTextColor (RGB(128,0,0)); // blue } ..... } This code works fine and radio button color gets changed but if i use xp theme in this project then text color of radio button does not set. To set xp theme, i add one custom resource which contains testdlg

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          I think you may need some extra code in your override, as described here[^]. BTW please use <pre> tags round your code snippets to make them more readable.

          Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman

          M 1 Reply Last reply
          0
          • L Lost User

            I think you may need some extra code in your override, as described here[^]. BTW please use <pre> tags round your code snippets to make them more readable.

            Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman

            M Offline
            M Offline
            MKC002
            wrote on last edited by
            #5

            I tried to use given example but the text color for radio button does not set. The background color of radio button is set. I noticed if i create a dialog box application in visual studio 2008,add one radio button and set its text color in OnCtlColor then the text color does not set.

            L 1 Reply Last reply
            0
            • M MKC002

              I tried to use given example but the text color for radio button does not set. The background color of radio button is set. I noticed if i create a dialog box application in visual studio 2008,add one radio button and set its text color in OnCtlColor then the text color does not set.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Unfortunately I do not have an MFC capable version of VS so I cannot test it myself.

              Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman

              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