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. Change the Color of Button

Change the Color of Button

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

    hi, How is it possible to change the color of a Button

    P A 2 Replies Last reply
    0
    • V vin

      hi, How is it possible to change the color of a Button

      P Offline
      P Offline
      Paul M Watt
      wrote on last edited by
      #2

      Subclass teh button then you can handle the WM_CTLCOLORBTN message. In this message you will set the color of the brush that you want the button to use instead of the default color.

      V N 2 Replies Last reply
      0
      • P Paul M Watt

        Subclass teh button then you can handle the WM_CTLCOLORBTN message. In this message you will set the color of the brush that you want the button to use instead of the default color.

        V Offline
        V Offline
        vin
        wrote on last edited by
        #3

        I done that method also...But I didn't get the color

        C 1 Reply Last reply
        0
        • V vin

          I done that method also...But I didn't get the color

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          You need to create a brush as a member object and return it from this function. Christian I have come to clean zee pooollll. - Michael Martin Dec 30, 2001 Picture the daffodil. And while you do that, I'll be over here going through your stuff.

          1 Reply Last reply
          0
          • V vin

            hi, How is it possible to change the color of a Button

            A Offline
            A Offline
            alex barylski
            wrote on last edited by
            #5

            Check out the following URL Chris's and subclassing buttons Very imformative!! Laterz !;P "An expert is someone who has made all the mistakes in his or her field" - Niels Bohr

            1 Reply Last reply
            0
            • P Paul M Watt

              Subclass teh button then you can handle the WM_CTLCOLORBTN message. In this message you will set the color of the brush that you want the button to use instead of the default color.

              N Offline
              N Offline
              Nish Nishant
              wrote on last edited by
              #6

              kilowatt wrote: Subclass teh button then you can handle the WM_CTLCOLORBTN message Only owner drawn buttons receive this message. Nish Nish was here, now Nish has gone; He left his soul, to turn you on; Those who knew Nish, knew him well; Those who didn't, can go to hell. I like to :jig: on the Code Project Sonork ID 100.9786 voidmain www.busterboy.org

              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