为什么 WPF 缺乏 HTML 支持?
为什么 WPF 缺乏 HTML 支持?我知道有框架
。但它甚至不应该被视为 WPF 控件(至少在呈现 HTML 时不应该)。我知道有一个带有浮动窗口的黑客,但那是废话!
我只想在 WPF 应用程序中的带有圆角和阴影的窗口中显示静态 HTML 文档。我碰壁了,我非常沮丧!
帮助!
Why does WPF lack HTML support? I know there is the Frame
. But that shouldn't even be considered a WPF control (not, at least, when it is rendering HTML). I know there is a hack with a floating window, but that's crap!
I just want to show a static HTML document in my WPF application, in a window with rounded corners and a drop shadow. I'm hitting a brick wall, and I'm incredibly frustrated!
HELP!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以在 WPF 应用程序中嵌入 Web 浏览器控件吗?然后,您的 WPF 应用程序可以在 WebBrowser 控件周围拥有漂亮的阴影,然后 WebBrowser 控件可以托管您的静态 HTML。
http://www.c-sharpcorner.com/ uploadfile/dhananjaycoder/web-browser-control-in-wpf/
Can you just embed a web browser control in your WPF app? Your WPF app can then have the nice looking drop shadow around the WebBrowser control, and then WebBrowser control can host your static HTML.
http://www.c-sharpcorner.com/uploadfile/dhananjaycoder/web-browser-control-in-wpf/
WPF 内置的功能非常有限。 WPF 不知道如何自行呈现 HTML - 它依赖于本机 Internet Explorer Web 浏览器 activex 控件(又名 Trident)来执行此操作。 activex 控件在“子窗口”中呈现在 wpf 窗口中任何其他内容的顶部。你对此无能为力。
最好的替代方案可能是切换到基于 Google Chrome 的控件,该控件没有此类限制:http://wpfchromium4。 codeplex.com/
you're pretty limited with the functionality built in to WPF. WPF doesn't know how to render HTML on its own - it relies on the native Internet Explorer web browser activex control (aka Trident) to do this. activex controls are rendered in "child windows" on top of any other content in your wpf window. nothing you can really do about this.
the best alternative is probably to switch to a Google Chrome-based control which does not have such a limitation: http://wpfchromium4.codeplex.com/