我怎样才能把web浏览器显示的背后我的控制? [英] How can I put WebBrowser display behind my control?

查看:106
本文介绍了我怎样才能把web浏览器显示的背后我的控制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让WebBrowser控件顶部的菜单中,因此当用户选择它,它会告诉web浏览器去centain页。

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...

但奇怪的web​​浏览器将始终显示在顶部....,它涵盖了我的扩展(菜单)。 我试图把web浏览器里面Carvas甚至按钮大声笑,但它仍然显示在顶部的web浏览器....

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....

我希望这不是在.NET 3.5中的错误......

I hope this is not a bug in .NET 3.5.....

推荐答案

简单的回答是,这是WPF的限制。

The short answer is this is a limitation of WPF.

web浏览器控制仅仅是Windows的COM组件,它有自己的窗口句柄周围的托管包装。出于这个原因,你不能在它上面绘制。

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.

更多细节: WPF 3.5 WebBrowser控件和zIndex的

这篇关于我怎样才能把web浏览器显示的背后我的控制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆