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 kno
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.
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.
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.
I must admit I don't know the differences, but if you hit problems you could perhaps use WindowsFormsHost to host the winform version in WPF, like so? Ultimately, both is a wrapper around shdocvw, so principles like "pure WPF" don't really apply.