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. How do we add color to a button?

How do we add color to a button?

Scheduled Pinned Locked Moved C / C++ / MFC
question
7 Posts 4 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.
  • W Offline
    W Offline
    waxie
    wrote on last edited by
    #1

    Hi, How do we change the color of the button? Thanks, Wax:rose:

    R S 2 Replies Last reply
    0
    • W waxie

      Hi, How do we change the color of the button? Thanks, Wax:rose:

      R Offline
      R Offline
      RChin
      wrote on last edited by
      #2

      You will need to implement an ownerdrawn button, if you need to change the appearance such as the face colour. Try one of the many button controls[^] thats here at CodeProject.


      I Dream of Absolute Zero

      1 Reply Last reply
      0
      • W waxie

        Hi, How do we change the color of the button? Thanks, Wax:rose:

        S Offline
        S Offline
        Stephen Hewitt
        wrote on last edited by
        #3

        Handle the WM_CTLCOLORBTN notification message in the parent window of the button. Steve

        O 1 Reply Last reply
        0
        • S Stephen Hewitt

          Handle the WM_CTLCOLORBTN notification message in the parent window of the button. Steve

          O Offline
          O Offline
          Owner drawn
          wrote on last edited by
          #4

          Stephen Hewitt wrote:

          Handle the WM_CTLCOLORBTN notification message in the parent window of the button.

          This won't work.

          Jesus Loves:rose:

          --Owner Drawn:rose: --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord:rose:

          S 1 Reply Last reply
          0
          • O Owner drawn

            Stephen Hewitt wrote:

            Handle the WM_CTLCOLORBTN notification message in the parent window of the button.

            This won't work.

            Jesus Loves:rose:

            --Owner Drawn:rose: --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord:rose:

            S Offline
            S Offline
            Stephen Hewitt
            wrote on last edited by
            #5

            I tried it just then and you are correct, it doesn't work. A more careful read of the documentation (as you often find yourself doing when stuff won't work) reveals the following: "only owner-drawn buttons respond to the parent window processing this message". Steve

            O 1 Reply Last reply
            0
            • S Stephen Hewitt

              I tried it just then and you are correct, it doesn't work. A more careful read of the documentation (as you often find yourself doing when stuff won't work) reveals the following: "only owner-drawn buttons respond to the parent window processing this message". Steve

              O Offline
              O Offline
              Owner drawn
              wrote on last edited by
              #6

              Stephen Hewitt wrote:

              I tried it just then and you are correct, it doesn't work

              Even I kept trying for sometime. What puzzles me is that what purpose does it accomplish?

              Jesus Loves:rose:

              --Owner Drawn:rose: --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord:rose:

              S 1 Reply Last reply
              0
              • O Owner drawn

                Stephen Hewitt wrote:

                I tried it just then and you are correct, it doesn't work

                Even I kept trying for sometime. What puzzles me is that what purpose does it accomplish?

                Jesus Loves:rose:

                --Owner Drawn:rose: --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord:rose:

                S Offline
                S Offline
                Stephen Hewitt
                wrote on last edited by
                #7

                I found myself wondering the same thing. Steve

                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