有没有一种方法来呈现在WPF WebBrowser控件的顶部WPF控件? [英] Is there a way to render WPF controls on top of the wpf WebBrowser control?

查看:1038
本文介绍了有没有一种方法来呈现在WPF WebBrowser控件的顶部WPF控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在我的应用程序嵌入WebBrowser控件,并且我有显示在它的上面WPF内容的问题。该应用程序有时会显示编辑数据弹出窗口或显示错误,和WebBrowser是越来越在弹出窗口的顶部绘制的,因为它是一个WinForms控制。

I need an embedded WebBrowser control in my application, and am having problems displaying WPF content on top of it. The application will sometimes show popups for editing data or to display errors, and the WebBrowser is getting drawn on top of the popups because it is a WinForms control.

我看了<一个替代href=\"http://karlshifflett.word$p$pss.com/2009/06/13/wpf-float-buttons-over-web-browser-control/\">here使用弹出控制投入的项目上WebBrowser控件的上方,但是,我与弹出窗口问题是,他们保持开放,当你切换到另一个应用程序,它们不与当用户调整/移动应用程序应用程序移动。

The alternative I looked at here uses a Popup control to put items on top of the WebBrowser control, however my problem with Popups is they stay open when you switch to another application, and they do not move with your application when the user resizes/moves the app.

是否有其他办法,我能做到这一点?嵌入式Web内容是aspx页面,因此没有静态的HTML。

Is there an alternative way I could do this? The embedded web content is aspx pages and so not static HTML.

推荐答案

嵌入式化网页浏览器吸,很遗憾。如果你显示的实际,真实,动态Web内容在你的web浏览器,你必须去通过另一个窗口自己链接到你的托管web浏览器窗口,并在操作移动/尺寸/等人的痛苦。我还没有看到,工程的另一种方式。

Embedded WebBrowsers suck, unfortunately. If you're displaying actual, real, dynamic web content in your WebBrowser, you have to go through the pain of linking another Window to your hosted WebBrowser's window, and handling moving/resizing/et al yourself. I haven't seen another way that works.

如果你正在显示(不同于可以控制或影响的来源或内容)静态内容,你可能会考虑在的DocumentViewer,而不是显示,比方说,RTF文档,它不具有web浏览器的过甜的空域问题控制。

If you're displaying static content (or content from a source that you can control or influence), you might consider displaying, say, RTF docs in a DocumentViewer instead, which doesn't have the icky airspace issues of the WebBrowser control.

这篇关于有没有一种方法来呈现在WPF WebBrowser控件的顶部WPF控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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