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. Transparency of controls

Transparency of controls

Scheduled Pinned Locked Moved C / C++ / MFC
c++csharpvisual-studiohelptutorial
5 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.
  • D Offline
    D Offline
    damir_tk
    wrote on last edited by
    #1

    Hi everybody, can anybody please direct me to a web site or an article (I could not find anything helpful) about how to make controls to be transparent. I use Visual Studio 2005 to make a Visual C++ dialog based application, and I use ATL only. Even though I specify a static control should be transparent, it is not. The background is static, it does not change, but neither static controls nor the captions of group box controls are rendered transparently. Thanks for your help.

    D 1 Reply Last reply
    0
    • D damir_tk

      Hi everybody, can anybody please direct me to a web site or an article (I could not find anything helpful) about how to make controls to be transparent. I use Visual Studio 2005 to make a Visual C++ dialog based application, and I use ATL only. Even though I specify a static control should be transparent, it is not. The background is static, it does not change, but neither static controls nor the captions of group box controls are rendered transparently. Thanks for your help.

      D Offline
      D Offline
      damir_tk
      wrote on last edited by
      #2

      Okay, I found it: I need to handle the message OnCtlColorStatic: ::SetBkMode((HDC)wParam, TRANSPARENT); return (LRESULT) GetStockObject (HOLLOW_BRUSH); and my static controls are all transparent. But I can still not make group box captions to be trtansparent. Thanks.

      M 1 Reply Last reply
      0
      • D damir_tk

        Okay, I found it: I need to handle the message OnCtlColorStatic: ::SetBkMode((HDC)wParam, TRANSPARENT); return (LRESULT) GetStockObject (HOLLOW_BRUSH); and my static controls are all transparent. But I can still not make group box captions to be trtansparent. Thanks.

        M Offline
        M Offline
        Mark Salsbery
        wrote on last edited by
        #3

        damir_tk wrote:

        But I can still not make group box captions to be trtansparent.

        Good luck with a trackbar control as well :)

        D 1 Reply Last reply
        0
        • M Mark Salsbery

          damir_tk wrote:

          But I can still not make group box captions to be trtansparent.

          Good luck with a trackbar control as well :)

          D Offline
          D Offline
          damir_tk
          wrote on last edited by
          #4

          Haha...no, I am not going to deal with that one. Anyways, if you know how to make the group box caption transparent, I would really appreciate it. Thanks.

          M 1 Reply Last reply
          0
          • D damir_tk

            Haha...no, I am not going to deal with that one. Anyways, if you know how to make the group box caption transparent, I would really appreciate it. Thanks.

            M Offline
            M Offline
            Mark Salsbery
            wrote on last edited by
            #5

            damir_tk wrote:

            Haha...no, I am not going to deal with that one

            :) Same problem with a groupbox. You can make it owner drawn and draw it yourself (it's a button). If only WM_EX_TRANSPARENT style was implemented for all controls...

            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