Reputation: 4302
I am trying to make a menu on top of WebBrowser control, so when user select it, it will tell the WebBrowser to go centain page.
So I did something like:
<Grid x:Name="Root">
<WebBrowser Name="_WebBrowser" Source="http://google.ca" Grid.Column="0" Grid.Row="0"></WebBrowser>
<Expander Name="expander1" HorizontalAlignment="Left" VerticalAlignment="Stretch" Width="250" ExpandDirection="Right" IsExpanded="True" Grid.Column="0" Grid.Row="0">
Far as I know, the last define control should be on top...
But strange, the WebBrowser will always display on top....and it covers my Expander (menu). I tried to put WebBrowser inside a Carvas or even Button lol But the WebBrowser it is still display on the top....
I hope this is not a bug in .NET 3.5.....
Upvotes: 3
Views: 4267
Reputation: 91608
The short answer is this is a limitation of WPF.
The WebBrowser
control is simply a managed wrapper around the Windows COM component, which has its own window handle. For this reason, you're not able to draw over it.
More details: WPF 3.5 WebBrowser control and ZIndex
Upvotes: 4