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. How to change Group box background color???

How to change Group box background color???

Scheduled Pinned Locked Moved C / C++ / MFC
comtutorialquestion
11 Posts 6 Posters 5 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 mimimimilaw

    http://x25.xanga.com/5e0a56246323262758465/m42072376.jpg[^] how to change the background color of the words "Hihi" in the group box??

    N Offline
    N Offline
    Naveen
    wrote on last edited by
    #2

    overide the WM_CTLCOLOR message and put the following code inside it if( nCtlColor == CTLCOLOR_STATIC) { pDC->SetBkMode( TRANSPARENT ); } this make the text backGround transparent. To change the color use pDC->SetBkColor( RGB(0,255,0)); instead of SetBkMode nave

    N 1 Reply Last reply
    0
    • N Naveen

      overide the WM_CTLCOLOR message and put the following code inside it if( nCtlColor == CTLCOLOR_STATIC) { pDC->SetBkMode( TRANSPARENT ); } this make the text backGround transparent. To change the color use pDC->SetBkColor( RGB(0,255,0)); instead of SetBkMode nave

      N Offline
      N Offline
      Nibu babu thomas
      wrote on last edited by
      #3

      Naveen R wrote:

      if( nCtlColor == CTLCOLOR_STATIC) { pDC->SetBkMode( TRANSPARENT ); }

      Groupbox is not a static control but a button control with style BS_GROUPBOX.


      Nibu thomas A Developer Programming tips[^]  My site[^]

      S H N 3 Replies Last reply
      0
      • N Nibu babu thomas

        Naveen R wrote:

        if( nCtlColor == CTLCOLOR_STATIC) { pDC->SetBkMode( TRANSPARENT ); }

        Groupbox is not a static control but a button control with style BS_GROUPBOX.


        Nibu thomas A Developer Programming tips[^]  My site[^]

        S Offline
        S Offline
        Sarath C
        wrote on last edited by
        #4

        It's the button style, but its CTLCOLOR classification is CTLCOLOR_STATIC not CTLCOLOR_BTN It seems that what naveen said was correct. SaRath.
        "It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar." My Blog | Understanding State Pattern in C++

        H 1 Reply Last reply
        0
        • M mimimimilaw

          http://x25.xanga.com/5e0a56246323262758465/m42072376.jpg[^] how to change the background color of the words "Hihi" in the group box??

          H Offline
          H Offline
          Hamid Taebi
          wrote on last edited by
          #5

          I wrote one example for you and i change background color from groupbox_**


          **_

          whitesky


          1 Reply Last reply
          0
          • N Nibu babu thomas

            Naveen R wrote:

            if( nCtlColor == CTLCOLOR_STATIC) { pDC->SetBkMode( TRANSPARENT ); }

            Groupbox is not a static control but a button control with style BS_GROUPBOX.


            Nibu thomas A Developer Programming tips[^]  My site[^]

            H Offline
            H Offline
            Hamid Taebi
            wrote on last edited by
            #6

            I created one static class for it_**


            **_

            whitesky


            N 1 Reply Last reply
            0
            • S Sarath C

              It's the button style, but its CTLCOLOR classification is CTLCOLOR_STATIC not CTLCOLOR_BTN It seems that what naveen said was correct. SaRath.
              "It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar." My Blog | Understanding State Pattern in C++

              H Offline
              H Offline
              Hamid Taebi
              wrote on last edited by
              #7

              SaRath C wrote:

              CTLCOLOR_STATIC not CTLCOLOR_BTN

              :)_**


              **_

              whitesky


              1 Reply Last reply
              0
              • N Nibu babu thomas

                Naveen R wrote:

                if( nCtlColor == CTLCOLOR_STATIC) { pDC->SetBkMode( TRANSPARENT ); }

                Groupbox is not a static control but a button control with style BS_GROUPBOX.


                Nibu thomas A Developer Programming tips[^]  My site[^]

                N Offline
                N Offline
                Naveen
                wrote on last edited by
                #8

                Try it creating a sample application...:) I am sure my code will work....?:-D nave

                1 Reply Last reply
                0
                • H Hamid Taebi

                  I created one static class for it_**


                  **_

                  whitesky


                  N Offline
                  N Offline
                  Naveen
                  wrote on last edited by
                  #9

                  WhiteSky wrote:

                  I created one static class for it

                  just for changing the color?:^) nave

                  H 1 Reply Last reply
                  0
                  • N Naveen

                    WhiteSky wrote:

                    I created one static class for it

                    just for changing the color?:^) nave

                    H Offline
                    H Offline
                    Hamid Taebi
                    wrote on last edited by
                    #10

                    ah no?, write one class for mimimimilaw_**


                    **_

                    whitesky


                    1 Reply Last reply
                    0
                    • M mimimimilaw

                      http://x25.xanga.com/5e0a56246323262758465/m42072376.jpg[^] how to change the background color of the words "Hihi" in the group box??

                      S Offline
                      S Offline
                      sudeesh
                      wrote on last edited by
                      #11

                      get the dc and make it transparent. hello

                      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