WPF和WinForms WebBrowser控件之间有什么功能上的差异存在? [英] What functional differences exist between WPF and WinForms WebBrowser control?
问题描述
WPF WebBrowser控件看起来很大,但知识accumlated随着时间的推移有关的WinForms web浏览器是巨大的,很难忽略像csExWB工作。这将是很好知道什么功能的缺点或优点存在于.NET 3.5的过度的WinForms WebBrowser控件WPF WebBrowser控件。尤其是,是否有可能在WPF web浏览器上建立csExWB样的功能?
WPF WebBrowser control looks great but knowledge accumlated over time about WinForms WebBrowser is substantial and it's hard to ignore work like csExWB. It would be nice to know what functional shortcomings or advantages exists in .NET 3.5's WPF WebBrowser control over WinForms WebBrowser control. In particular, is it possible to build csExWB-like functionality on top of WPF WebBrowser?
推荐答案
从挫折之一,WPF的成分整天,这是我发现的。显然,网页浏览器的winforms暴露得多的方法和属性。举例来说,有没有 IsWebBrowserContextMenuEnabled
, ActiveXInstance
等在WPF web浏览器。
From one full day of frustration with wpf's component, here's what I discovered. Apparently, winforms webbrowser exposes much more methods and properties. For instance, there's no IsWebBrowserContextMenuEnabled
, ActiveXInstance
, etc. in wpf webbrowser.
此外,文件
每个属性包含不同类型的对象。 Winform的包含键入 System.Windows.Forms.HtmlDocument
的有一些有趣的方法和属性,如 PointToClient
和文档 GetElementFromPoint
。 WPF web浏览器文档是对象
键入文档可以转换为 mshtml.HtmlDocument
,只提供了相同的方法和从一个标准的HTML + JavaScript的文档属性。不是很令人兴奋的。我不知道这是否可以转换为其他的东西(有用的是)因为有关于它没有真正的文档。
Also, the document
property of each contains different types of objects. Winform contains a document of type System.Windows.Forms.HtmlDocument
with a few interesting methods and properties like PointToClient
and GetElementFromPoint
. Wpf webbrowser document is an Object
type document that can be cast to mshtml.HtmlDocument
, which only provides the same methods and properties available from a standard html + javascript document. Not very exciting. I don't know if it can be cast to something else (useful that is) since there's no real documentation about it.
唯一的缺点我能注意到的WinForms的网页浏览器是该组件内的按钮和滚动条不具有相同的外观WPF的本地控制。
The only disadvantage I could notice about winforms webbrowser is that the buttons and scrollbars inside the component don't have the same appearance as the wpf native controls.
这篇关于WPF和WinForms WebBrowser控件之间有什么功能上的差异存在?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!