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#
  4. Transparent control, C#

Transparent control, C#

Scheduled Pinned Locked Moved C#
csharpcomhelpquestion
6 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.
  • T Offline
    T Offline
    TwilightEva
    wrote on last edited by
    #1

    Sorry for such question (I think it was earlier, but my problem is below): I'm trying to find transparent controls and all I'd found are only ones, which background-transparent, but not on-control-transparent: picture: Transparent[^] As you can see, usual button cannot be seen under glass transparent button.

    S 1 Reply Last reply
    0
    • T TwilightEva

      Sorry for such question (I think it was earlier, but my problem is below): I'm trying to find transparent controls and all I'd found are only ones, which background-transparent, but not on-control-transparent: picture: Transparent[^] As you can see, usual button cannot be seen under glass transparent button.

      S Offline
      S Offline
      Super Lloyd
      wrote on last edited by
      #2

      it's because, in WinForm, transparency is faked by calling OnPaintBackground() of the parent from the child control. There is no solution I'm afraid... But it works like a charm in WPF if you must know! ;P

      A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.

      T 1 Reply Last reply
      0
      • S Super Lloyd

        it's because, in WinForm, transparency is faked by calling OnPaintBackground() of the parent from the child control. There is no solution I'm afraid... But it works like a charm in WPF if you must know! ;P

        A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.

        T Offline
        T Offline
        TwilightEva
        wrote on last edited by
        #3

        and is there any way to "inherit" form opacity? on WPF, i know -\

        S 1 Reply Last reply
        0
        • T TwilightEva

          and is there any way to "inherit" form opacity? on WPF, i know -\

          S Offline
          S Offline
          Super Lloyd
          wrote on last edited by
          #4

          In WPF all control are transparent. This is made easy due to the fact that there is only one operating system Window/HWND object: the top level object (the form). I.e. everything (save the top level window) is just a logical object not backed-up / constrained by any OS handle. However the Windows OS does support Windows transparency, and so WPF can support it too. There is a flag to set somewhere to have a transparent window. I haven't use it much so I forgot, but it's easy.

          A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.

          T 1 Reply Last reply
          0
          • S Super Lloyd

            In WPF all control are transparent. This is made easy due to the fact that there is only one operating system Window/HWND object: the top level object (the form). I.e. everything (save the top level window) is just a logical object not backed-up / constrained by any OS handle. However the Windows OS does support Windows transparency, and so WPF can support it too. There is a flag to set somewhere to have a transparent window. I haven't use it much so I forgot, but it's easy.

            A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.

            T Offline
            T Offline
            TwilightEva
            wrote on last edited by
            #5

            flag somewhere, where not everyone can see?(

            S 1 Reply Last reply
            0
            • T TwilightEva

              flag somewhere, where not everyone can see?(

              S Offline
              S Offline
              Super Lloyd
              wrote on last edited by
              #6

              Flag somewhere that everyone can see in the documentation! Popup.AllowsTransparency Window.AllowsTransparency It is advised to read the documentation to known about additional little quirks, like this one: "When the Background property of a window is set to a transparent color, using Transparent for example, the window remains opaque. This means that the desktop and any running applications "beneath" the window cannot be seen. To enable this type of transparency, AllowsTransparency must be set to true. AllowsTransparency exists to facilitate the creation of non-rectangular windows, and, consequently, when AllowsTransparency is set to true, a window's WindowStyle property must be set to None."

              A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.

              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