将弹出窗口放在wpf应用程序中的Web浏览器控件上 [英] Place a popup on to web browser control in wpf application

查看:109
本文介绍了将弹出窗口放在wpf应用程序中的Web浏览器控件上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有一个使用WPF 3.5构建的应用程序。



我们正在渲染网页,在WPF的WebBrowser控件中的WPF应用程序中。

我们需要在WPF-WebBrowser控件之上显示一个用户控件作为弹出窗口。



浏览过网页并发现了AirSpace问题。



任何关于相同的线索/解决方案都将非常感激。



谢谢,

Nitish Srivastava



我的尝试:



已搜索问题,并找到了实施的典型方案。了解SetWindowPos(),但不知道如何实现相同的。

Hi,

I have a application build in WPF 3.5.

We are rendering a web page , in WPF application in WebBrowser control of WPF.
We need to show a usercontrol as an Popup on top of WPF-WebBrowser control.

Have browsed over web and found its an AirSpace problem.

Any clue/soln regarding the same will be very grateful.

Thanks,
Nitish Srivastava

What I have tried:

Have searched for the problem , and found typical scenario to implement. Got clue about SetWindowPos() but doesn't know how to implement the same.

推荐答案

WebBrowser 控件只是一个ActiveX控件的薄包装器。因此,它在WPF应用程序中遇到空域问题,并且没有简单的方法来解决这个问题。

减少WPF应用程序中的空域问题 - 演示源 - 站点主页 - MSDN博客 [ ^ ]



(这将在.NET 4.5中得到修复,但最终会在发布之前将其删除。)



此外,除非您在运行应用程序的每台计算机上调整注册表,否则控件是陷入IE7模式 [ ^ ]。这意味着您不能在您显示的页面中使用任何现代功能,有些网站可能根本无法使用。



解决方案是使用正确的WPF控件没有这些问题。你最好的选择可能是 CEFSharp [ ^ ],它使用与Google Chrome相同的渲染引擎。甚至还有 WPF快速入门指南 [ ^ ]这里是CodeProject。
The WebBrowser control is just a thin wrapper around an ActiveX control. As such, it suffers from airspace problems in WPF applications, and there's no easy way to resolve that.
Mitigating Airspace Issues In WPF Applications - Presentation Source - Site Home - MSDN Blogs[^]

(This was going to be fixed in .NET 4.5, but they ended up dropping it before release.)

Also, unless you tweak the registry on every computer that runs your application, the control is stuck in IE7 mode[^]. That means you can't use any modern features in the pages you display, and some sites might not work at all.

The solution is to use a proper WPF control which doesn't have these problems. Your best bet is probably CEFSharp[^], which uses the same rendering engine as Google Chrome. There's even a WPF Quick Start guide[^] here on CodeProject.


我们没有任何与之相关的示例项目。我们可以使用Popup Expander吗?
Don't we have any sample project relates to the same. Can we do the same using Popup Expander ?


这篇关于将弹出窗口放在wpf应用程序中的Web浏览器控件上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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