如何在 webbrowser WPF 顶部打开用户控件作为弹出窗口 [英] How to open User control as Popup on top of webbrowser WPF

查看:41
本文介绍了如何在 webbrowser WPF 顶部打开用户控件作为弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

层次如下

<Grid>
    <WebBrowser ></WebBrowser>
</Grid>

现在我想向 Grid 添加另一个子项,该子项将显示为 PopUp.这在任何地方都有效,但是当我们在 Grid 中有一个 WebBrowser 作为子项时它不起作用.

Now I want to add another child to the Grid which will be shown as a PopUp. This works everywhere but when we have a WebBrowser as a child in the Grid it is not working.

推荐答案

遗憾的是,WPF 中的 Webbrowser Control 无法实现.

Unfortunately, its not possible with Webbrowser Control in WPF.

WebBrowser 控件您使用的不是实际的 WPF 控件.它只是一个包装好的 winforms webcontrol .无法在其上显示 WPF 内容.

WebBrowser control what you are using is not an actual WPF control. Its just a wrapped winforms webcontrol . Its impossible to show the WPF content on top of it.

SO 中的类似问题,您可以在其中查看解决方法:

让 WPF 控制网络浏览器

这篇关于如何在 webbrowser WPF 顶部打开用户控件作为弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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