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. WPF
  4. ElementHost and Transparency

ElementHost and Transparency

Scheduled Pinned Locked Moved WPF
csharphelpquestionwpfwinforms
3 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.
  • F Offline
    F Offline
    Firedragonweb
    wrote on last edited by
    #1

    Hi, I'm trying to write a Winforms Application, in which one Windows has the sole purpose to host a WPF Control. The window itself is transparent (using the TransparencyKey-Property) and so are parts of the hosted WPF control(Using Background-Color=Transparent). The ElementHost has its BackColorTransparent property set to true. Problem is: The transparent areas of the WPF control are painted in the background color of the winforms-host. The one that should be replaced by transparency (because of the TransparencyKey). Seems like an airspace-problem to me, but I'm not sure about that. How can i achieve true transparency (so i can see the underlying desktop through my WPF Control)? Any help would be appreciated. Michael.

    G 1 Reply Last reply
    0
    • F Firedragonweb

      Hi, I'm trying to write a Winforms Application, in which one Windows has the sole purpose to host a WPF Control. The window itself is transparent (using the TransparencyKey-Property) and so are parts of the hosted WPF control(Using Background-Color=Transparent). The ElementHost has its BackColorTransparent property set to true. Problem is: The transparent areas of the WPF control are painted in the background color of the winforms-host. The one that should be replaced by transparency (because of the TransparencyKey). Seems like an airspace-problem to me, but I'm not sure about that. How can i achieve true transparency (so i can see the underlying desktop through my WPF Control)? Any help would be appreciated. Michael.

      G Offline
      G Offline
      Gideon Engelberth
      wrote on last edited by
      #2

      I've never actually done it, but I don't see any reason you couldn't just have a WPF window and create and launch it from your Winforms Form. Then you don't have to worry about airspace and interop problems.

      F 1 Reply Last reply
      0
      • G Gideon Engelberth

        I've never actually done it, but I don't see any reason you couldn't just have a WPF window and create and launch it from your Winforms Form. Then you don't have to worry about airspace and interop problems.

        F Offline
        F Offline
        Firedragonweb
        wrote on last edited by
        #3

        Simple, but did it - didn't thought of it, because Visual Studio won't let you add one in a Winforms-project. Thanks.

        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