WPF 3.5 WebBrowser控件和zIndex的 [英] WPF 3.5 WebBrowser control and ZIndex

查看:212
本文介绍了WPF 3.5 WebBrowser控件和zIndex的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找出为什么控制不接受zIndex的。

I'm trying to figure out why the control does not honor ZIndex.

示例1 - 工作正常

Example 1 - which works fine

   <Canvas>
       <Rectangle Canvas.ZIndex="1" Height="400" Width="600" Fill="Yellow"/>
       <Rectangle Canvas.ZIndex="2" Height="100" Width="100" Fill="Red"/>
   </Canvas>

示例2 ​​- 不工作

Example 2 - which does not work

   <Canvas>
       <WebBrowser Canvas.ZIndex="1" Height="400" Width="600" Source="http://www.stackoverflow.com"/>
       <Rectangle Canvas.ZIndex="2" Height="100" Width="100" Fill="Red"/>
  </Canvas>

谢谢,
- 埃德

Thanks, -- Ed

推荐答案

不幸的是,这是因为WebBrowser控件是围绕着Internet Explorer的COM控件的包装。这意味着它获取自己的HWND和不允许WPF超过它画任何东西。它具有相同的限制托管在WPF任何其他的Win32或WinForms的控制。

Unfortunately this is because the WebBrowser control is a wrapper around the Internet Explorer COM control. This means that it gets its own HWND and does not allow WPF to draw anything over it. It has the same restrictions as hosting any other Win32 or WinForms control in WPF.

MSDN 大约有WPF / Win32的互操作的更多信息。

MSDN has more information about WPF/Win32 interop.

这篇关于WPF 3.5 WebBrowser控件和zIndex的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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