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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. checkbox caption

checkbox caption

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
5 Posts 4 Posters 1 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
    subramanyeswari
    wrote on last edited by
    #1

    how to change the color of caption text for a checkbox?

    O 1 Reply Last reply
    0
    • S subramanyeswari

      how to change the color of caption text for a checkbox?

      O Offline
      O Offline
      only coder
      wrote on last edited by
      #2

      WM_CTLCOLOR

      S 1 Reply Last reply
      0
      • O only coder

        WM_CTLCOLOR

        S Offline
        S Offline
        subramanyeswari
        wrote on last edited by
        #3

        Can i use WM_CTLCOLOR in oninitdialog function. I want to set the color of caption text of a checkbox before displaying dialog in VC++.

        N T 2 Replies Last reply
        0
        • S subramanyeswari

          Can i use WM_CTLCOLOR in oninitdialog function. I want to set the color of caption text of a checkbox before displaying dialog in VC++.

          N Offline
          N Offline
          Nelek
          wrote on last edited by
          #4

          I think is the best place to use it. In the constructor you may have error/assertion because the window is not already created so you dont have any possibility to access visual controls, m_hWnd will be NULL and give you problems. But in OnInitDialog all the objects are already created and it is called the very first time the dialog and its components are shown in the screen.

          Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you “The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson ;)

          1 Reply Last reply
          0
          • S subramanyeswari

            Can i use WM_CTLCOLOR in oninitdialog function. I want to set the color of caption text of a checkbox before displaying dialog in VC++.

            T Offline
            T Offline
            ThatsAlok
            wrote on last edited by
            #5

            subramanyeswari wrote:

            Can i use WM_CTLCOLOR in oninitdialog function. I want to set the color of caption text of a checkbox before displaying dialog in VC++.

            you have to regularly handle teh OnCtlColor message for coloring the check box, and have to use SetTextColor there!

            "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
            Never mind - my own stupidity is the source of every "problem" - Mixture

            cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You

            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