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. Change of Background Color of dialog box

Change of Background Color of dialog box

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
10 Posts 7 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.
  • M Offline
    M Offline
    Manmohan_1983
    wrote on last edited by
    #1

    How to Change of Background Color of dialog box,with options? Manmohan

    K A T 3 Replies Last reply
    0
    • M Manmohan_1983

      How to Change of Background Color of dialog box,with options? Manmohan

      K Offline
      K Offline
      khan
      wrote on last edited by
      #2

      Handle the WM_ERASEBKGND message for the dialog. OnEraseBkgnd(CDC* pDC) { CRect rect; GetClientRect(&rect); pDC->FillSolidRect(&rect,RGB(255,0,0)); return TRUE; //return CDialog::OnEraseBkgnd(pDC); } this is this.

      E 2 Replies Last reply
      0
      • M Manmohan_1983

        How to Change of Background Color of dialog box,with options? Manmohan

        A Offline
        A Offline
        Arman S
        wrote on last edited by
        #3

        Handle WM_CTLCOLOR. -- ====== Arman

        1 Reply Last reply
        0
        • K khan

          Handle the WM_ERASEBKGND message for the dialog. OnEraseBkgnd(CDC* pDC) { CRect rect; GetClientRect(&rect); pDC->FillSolidRect(&rect,RGB(255,0,0)); return TRUE; //return CDialog::OnEraseBkgnd(pDC); } this is this.

          E Offline
          E Offline
          Eytukan
          wrote on last edited by
          #4

          for first time, i'm able to find a different reply for this query.


          "But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho

          --[V]--

          1 Reply Last reply
          0
          • K khan

            Handle the WM_ERASEBKGND message for the dialog. OnEraseBkgnd(CDC* pDC) { CRect rect; GetClientRect(&rect); pDC->FillSolidRect(&rect,RGB(255,0,0)); return TRUE; //return CDialog::OnEraseBkgnd(pDC); } this is this.

            E Offline
            E Offline
            Eytukan
            wrote on last edited by
            #5

            in the message map, is it ON_WM_ERASEBKGND() ??


            "But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho

            --[V]--

            K 1 Reply Last reply
            0
            • E Eytukan

              in the message map, is it ON_WM_ERASEBKGND() ??


              "But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho

              --[V]--

              K Offline
              K Offline
              khan
              wrote on last edited by
              #6

              Exactly. In the message-map: ON_WM_ERASEBKGND() In the header: afx_msg BOOL OnEraseBkgnd(CDC* pDC); In the implementation: BOOL CWhateverDialog::OnEraseBkgnd(CDC* pDC) I am about to go eat some cake. Happy birthday to this! this is this.

              V E 2 Replies Last reply
              0
              • K khan

                Exactly. In the message-map: ON_WM_ERASEBKGND() In the header: afx_msg BOOL OnEraseBkgnd(CDC* pDC); In the implementation: BOOL CWhateverDialog::OnEraseBkgnd(CDC* pDC) I am about to go eat some cake. Happy birthday to this! this is this.

                V Offline
                V Offline
                VikramDelhi i
                wrote on last edited by
                #7

                thanks for this technique.:)

                1 Reply Last reply
                0
                • K khan

                  Exactly. In the message-map: ON_WM_ERASEBKGND() In the header: afx_msg BOOL OnEraseBkgnd(CDC* pDC); In the implementation: BOOL CWhateverDialog::OnEraseBkgnd(CDC* pDC) I am about to go eat some cake. Happy birthday to this! this is this.

                  E Offline
                  E Offline
                  Eytukan
                  wrote on last edited by
                  #8

                  i'll try this, anyhow anything from Mr Khan has always worked fine. so my 5 to you inadvance.


                  "But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho

                  --[V]--

                  L 1 Reply Last reply
                  0
                  • E Eytukan

                    i'll try this, anyhow anything from Mr Khan has always worked fine. so my 5 to you inadvance.


                    "But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho

                    --[V]--

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #9

                    try this also , see what you get:

                    CYourDialog::OnEraseBkgnd(CDC* pDC)
                    {
                    return TRUE;
                    }

                    I've used this for writing joke programs for my friends sometimes:)


                    "Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill

                    1 Reply Last reply
                    0
                    • M Manmohan_1983

                      How to Change of Background Color of dialog box,with options? Manmohan

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

                      Manmohan_1983 wrote:

                      How to Change of Background Color of dialog box,with options?

                      WM_CTLCOLOR[^]

                      "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

                      cheers, Alok Gupta VC Forum Q&A :- I/ IV

                      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