ElementHost and Transparency
-
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.
-
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.
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.
-
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.
Simple, but did it - didn't thought of it, because Visual Studio won't let you add one in a Winforms-project. Thanks.