WPF WebBrowser ZIndex Problem RRS feed

  • Question

  • Hi..

    I have a WPF WebBrowser control placed on a form and I want a set of buttons or other controls that should float over it. I know WPF webbrowser is a actually a WPF wrap around of the WebBrowser control in WinForms. Therefore it doesn't obey the WPF ZIndex rules. I couldn't find an alternate to do the same. I believe there must be a way or workaround to place other controls over a webbrowser control. Guys, do you know any workaround or solutions to get this done? Any help will greatly be appreciated.

    Monday, October 24, 2011 5:50 AM

All replies

  • May I ask what you're trying to accomplish? If we know what you're trying to do, we may be able to better suggest alternatives to your current method.
    Tuesday, October 25, 2011 3:53 PM
  • Hi..

    My application has two panes implemented in two columns of the LayoutRoot grid. The left pane is fully consumed by the web browser. I made it fit horizontally and vertically. In my design, I wish to have a floating close button on the top right corner of the web browser, which, on click, collapases the left pane and shows the right pane of the application only. It is considered to be performing collapse. As the web browser is fit horizontally and vertically within ColumnDefinition[0] of LayoutRoot grid, I will need to float my close button over the WebBrowser control according to the rules of ZIndex. Is there any solution to get it done? I considered popup, but it is is shown "ABOVE EVERYTHING" on my desktop and it also doesn't move with the window when I displace it by dragging. What to do? :-(

    Thursday, October 27, 2011 4:35 AM
  • Friday, October 28, 2011 4:06 PM
  • Hi..

    Thanks for your reply. This is a workaround, right? Is there any native method available for doing the same? Definitely I am going to give it a try as I want to make it work. I think I will need to spend some time in studying the code in this link

    Monday, October 31, 2011 8:26 AM
  • When I was working on my program I too had inserted a webbrowser control and the zindex thing drove me nuts for awhile.  I simply had to redesign around it.

    My best understanding in searching for a solution for this is that the webbrowser control is actually not a part of the wpf program and will always be on top.

    Here is a page I had bookmarked for this, I could never get this to work, but my c#/WPF knowledge is pretty limited.  So you will probably have no problems.




    And here is a MSDN explanation of how it works... http://msdn.microsoft.com/en-us/library/aa970688(v=VS.85).aspx


    Several people have found work arounds though, so just search the wpf forums.



    Monday, October 31, 2011 3:29 PM
  • Hi...

    Thank you Christine... Thanks for your time

    Tuesday, November 1, 2011 10:08 AM