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. static control color

static control color

Scheduled Pinned Locked Moved C / C++ / MFC
questiontutorial
5 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.
  • C Offline
    C Offline
    Cedric Moonen
    wrote on last edited by
    #1

    Hi !! This is a little stupid question but I don't know how to make it :) I derived a class from the CStatic class and I draw the control myself in the Paint() function. But know I want it to have the "normal" grey color (the color of a standard push button for exaple) in the background. Does anybody know the RGB color code of it ? Thanks

    A 1 Reply Last reply
    0
    • C Cedric Moonen

      Hi !! This is a little stupid question but I don't know how to make it :) I derived a class from the CStatic class and I draw the control myself in the Paint() function. But know I want it to have the "normal" grey color (the color of a standard push button for exaple) in the background. Does anybody know the RGB color code of it ? Thanks

      A Offline
      A Offline
      Alin Negru
      wrote on last edited by
      #2

      RGB(192, 192, 192) :)

      C G 2 Replies Last reply
      0
      • A Alin Negru

        RGB(192, 192, 192) :)

        C Offline
        C Offline
        Cedric Moonen
        wrote on last edited by
        #3

        Thanks but it's not the same gray :(! So, it's quite ugly because I use this control on a form so the colors are not exactly the same

        1 Reply Last reply
        0
        • A Alin Negru

          RGB(192, 192, 192) :)

          G Offline
          G Offline
          Gunnar Bolle
          wrote on last edited by
          #4

          uhh, bad idea - the color depends on your os settings. use ::GetSysColor(COLOR_BTNFACE) that should do it.

          C 1 Reply Last reply
          0
          • G Gunnar Bolle

            uhh, bad idea - the color depends on your os settings. use ::GetSysColor(COLOR_BTNFACE) that should do it.

            C Offline
            C Offline
            Cedric Moonen
            wrote on last edited by
            #5

            Thanks a lot!! I was exactly searching for something like that :)

            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