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. How to set the BackGround color of a window?

How to set the BackGround color of a window?

Scheduled Pinned Locked Moved C / C++ / MFC
questioncomhelptutorial
3 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.
  • E Offline
    E Offline
    eli15021979
    wrote on last edited by
    #1

    Hi, I'm using this wonderful Tab control : http://www.codeproject.com/tabctrl/XPTabApp.asp[^] my problem is that the background color of the tab control is white,and when i'm adding a window to a tab,the window background color is gray. How can I set the Background color of the window to the tab control color? I tried to set the transparent property of the window to true but it's not working. Also,I tried to do this with the following:

    CDC *pDC = MyWindow->GetDC();

    SetBkColor(pDC->m_hDC , RGB(255,255,255));
    ReleaseDC(pDC);

    But again,it's not working. anyone? regards, Eli :doh:

    T Mircea PuiuM 2 Replies Last reply
    0
    • E eli15021979

      Hi, I'm using this wonderful Tab control : http://www.codeproject.com/tabctrl/XPTabApp.asp[^] my problem is that the background color of the tab control is white,and when i'm adding a window to a tab,the window background color is gray. How can I set the Background color of the window to the tab control color? I tried to set the transparent property of the window to true but it's not working. Also,I tried to do this with the following:

      CDC *pDC = MyWindow->GetDC();

      SetBkColor(pDC->m_hDC , RGB(255,255,255));
      ReleaseDC(pDC);

      But again,it's not working. anyone? regards, Eli :doh:

      T Offline
      T Offline
      ThiefXXX
      wrote on last edited by
      #2

      You can handle WM_ERASEBKGND message

      1 Reply Last reply
      0
      • E eli15021979

        Hi, I'm using this wonderful Tab control : http://www.codeproject.com/tabctrl/XPTabApp.asp[^] my problem is that the background color of the tab control is white,and when i'm adding a window to a tab,the window background color is gray. How can I set the Background color of the window to the tab control color? I tried to set the transparent property of the window to true but it's not working. Also,I tried to do this with the following:

        CDC *pDC = MyWindow->GetDC();

        SetBkColor(pDC->m_hDC , RGB(255,255,255));
        ReleaseDC(pDC);

        But again,it's not working. anyone? regards, Eli :doh:

        Mircea PuiuM Offline
        Mircea PuiuM Offline
        Mircea Puiu
        wrote on last edited by
        #3

        It depends on the ... window. Could you be more explicit ? SkyWalker

        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