none
WPF WebBrowser - in a Transparent Window

    Question

  • I have in w transparent window a webbrowser but it doesn't show.
    If i put this in the window xaml file  AllowsTransparency="True" WindowStyle="None" the browser doesn't appear. if i put  AllowsTransparency="False" WindowStyle="None" the browser appears.


    I used their example from http://msdn.microsoft.com/en-us/library/system.windows.controls.webbrowser.aspx but i have that problem.

    Anyone with a solution or maybe the guys form WPF sould resolve this bug. :)

    P.S. I stil lwant to use Transparent Window.

    Kee it simple
    Wednesday, August 27, 2008 7:47 AM

Answers

  • You can't use a WebBrowser in a window with transparency. It's simply not supported.
    Controls for WPF and Windows Forms at http://www.divelements.co.uk
    Wednesday, August 27, 2008 2:54 PM

All replies

  • You can't use a WebBrowser in a window with transparency. It's simply not supported.
    Controls for WPF and Windows Forms at http://www.divelements.co.uk
    Wednesday, August 27, 2008 2:54 PM
  • Huh??? "It's simply not supported"??? What kind of answer is that?  We're able to build wpf apps that have "borderless" windows but if an app needs to use the webbrowser that window must break the ui consistency of the app by requiring a border??? Is there a real reason  for this lack of support for transparency? 

    What's Microsoft's response to this inconsistency- all other wpf controls support AllowsTransparency = true (or at least I haven't found one that doesn't yet).

    Obviously our app needs this support and we need this fixed asap!
    Saturday, November 01, 2008 6:44 PM
  • Unfortunately you're not about to get this fixed. It is a fundamental limitation of Windows that top-level windows with per-pixel alpha cannot host child windows. A web browser is an hwnd-based window so counts as a child window in the win32 sense. It's the same when you try and host any hwnd-based control in a WPF app.

    Even if Microsoft managed to support this in Windows 7, it would still be useless as presumably you'd need to also support XP/2003/Vista.

    WPF is subject to the same limitations as the rest of Windows.
    Controls for WPF and Windows Forms at http://www.divelements.co.uk
    Sunday, November 02, 2008 10:06 AM
  •  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.


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Tuesday, January 20, 2009 12:17 AM