WPF WebBrowser control issues with AllowsTransparency = True

7.July.08 – 15:55

I recently played around with the new Webbrowser control delivered with the SP1 update of .NET 3.5 .
But when i tried to use it in a WPF Window that has its WindowStyle set to None and AllowsTransparency to True (due to some custom window drawing), i noticed that the Webbrowser control disappeared.  

The Webbrowser control is just a native Win32 Hwnd that gets hosted inside some WPF content area. But it’s quite annoying that the Transparency stuff gets pass on to it.
I wonder how i could circumvent this limitation as i don’t need transparency in the webbrowser control itself. Its just to get some homegrown, fancy-looking window style.

I’m looking forward to see this fixed by Microsoft in some future release.

  1. 3 Responses to “WPF WebBrowser control issues with AllowsTransparency = True”

  2. Hello, did you ever find a work around for this? I’m interested in doing something similar.

    By Chris on Sep 25, 2008

  3. hi chris,

    it’s bad that there is no pure .net solution for this limitation (yet)! i wrote a workaround with win32 native calls to draw the stuff myself. Jan-Cornelius Molnar has a short blogpost
    on this topic which gave me the initial idea to just do it myself. Although it’s VB.NET it may be a good starting point.
    regards
    j.

    By jkersch on Sep 25, 2008

  4. It’s unlikely there will be a general solution for the child window composition problem anytime soon. Here is one possible workaround now: http://blogs.msdn.com/changov/archive/2009/01/19/webbrowser-control-on-transparent-wpf-window.aspx.

    By Chango V. on Jan 20, 2009

Post a Comment

Comment spam protected by SpamBam