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. dialog color

dialog color

Scheduled Pinned Locked Moved C / C++ / MFC
8 Posts 2 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.
  • J Offline
    J Offline
    jeepoo
    wrote on last edited by
    #1

    hi i am having a dialog name NETDIALOG whose background is having another dialog BACKDIALOG stretched to full screen.if i opend the NETDIALOG its background color is same as the BACKDIALOG.i have to avoid this. what i have to do. the NETDIALOG should open with its own color.

    J 1 Reply Last reply
    0
    • J jeepoo

      hi i am having a dialog name NETDIALOG whose background is having another dialog BACKDIALOG stretched to full screen.if i opend the NETDIALOG its background color is same as the BACKDIALOG.i have to avoid this. what i have to do. the NETDIALOG should open with its own color.

      J Offline
      J Offline
      Joan M
      wrote on last edited by
      #2

      I used to handle the OnPaint message: void CDlgPPAGMain::OnPaint() { CPaintDC dc(this); // device context for painting CRect r, r2; if( GetSafeHwnd() != 0 && m_clctrlParamsRobotSel.GetSafeHwnd() != 0) { GetClientRect(&r); m_clctrlParamsRobotSel.GetWindowRect(&r2); ScreenToClient(&r2); r.bottom = r2.top; dc.FillSolidRect(r,0x000000); } } Sure that this is not the best method, but it works.

      https://www.robotecnik.com freelance robots, PLC and CNC programmer.

      J 1 Reply Last reply
      0
      • J Joan M

        I used to handle the OnPaint message: void CDlgPPAGMain::OnPaint() { CPaintDC dc(this); // device context for painting CRect r, r2; if( GetSafeHwnd() != 0 && m_clctrlParamsRobotSel.GetSafeHwnd() != 0) { GetClientRect(&r); m_clctrlParamsRobotSel.GetWindowRect(&r2); ScreenToClient(&r2); r.bottom = r2.top; dc.FillSolidRect(r,0x000000); } } Sure that this is not the best method, but it works.

        J Offline
        J Offline
        jeepoo
        wrote on last edited by
        #3

        what is m_clctrlParamsRobotSel?

        J 2 Replies Last reply
        0
        • J jeepoo

          what is m_clctrlParamsRobotSel?

          J Offline
          J Offline
          Joan M
          wrote on last edited by
          #4

          Don't worry on that, this is a piece of code that I've used and I've not removed anything, this is a variable that refers to a listcontrol that has the same width of the entire dialog, in your case you should get the size of the dialog client are and then paint it.

          https://www.robotecnik.com freelance robots, PLC and CNC programmer.

          1 Reply Last reply
          0
          • J jeepoo

            what is m_clctrlParamsRobotSel?

            J Offline
            J Offline
            Joan M
            wrote on last edited by
            #5

            void CDlgPPAGMain::OnPaint() { CPaintDC dc(this); // device context for painting CRect r; if(GetSafeHwnd() != 0) { GetClientRect(&r); dc.FillSolidRect(r,0x000000); } } this should be ok for you...

            https://www.robotecnik.com freelance robots, PLC and CNC programmer.

            J 1 Reply Last reply
            0
            • J Joan M

              void CDlgPPAGMain::OnPaint() { CPaintDC dc(this); // device context for painting CRect r; if(GetSafeHwnd() != 0) { GetClientRect(&r); dc.FillSolidRect(r,0x000000); } } this should be ok for you...

              J Offline
              J Offline
              jeepoo
              wrote on last edited by
              #6

              yes thats working well. how we can change the background color of tab control.

              J 1 Reply Last reply
              0
              • J jeepoo

                yes thats working well. how we can change the background color of tab control.

                J Offline
                J Offline
                Joan M
                wrote on last edited by
                #7

                Hey! that's new, I've re-read the first post, in order to do that there is an article here in the CP that explains how to do it. I promise you that I don't remember how to do it, but I've seen a post regarding to that this same week here in the VC forum. Try to search for that, sure that it will work for you.

                https://www.robotecnik.com freelance robots, PLC and CNC programmer.

                J 1 Reply Last reply
                0
                • J Joan M

                  Hey! that's new, I've re-read the first post, in order to do that there is an article here in the CP that explains how to do it. I promise you that I don't remember how to do it, but I've seen a post regarding to that this same week here in the VC forum. Try to search for that, sure that it will work for you.

                  J Offline
                  J Offline
                  jeepoo
                  wrote on last edited by
                  #8

                  hi i used onpaint method to change the background color. but in vain. what i have to do to change the background color of the tab control.

                  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