What functional differences exist between WPF and WinForms WebBrowser control?

前端 未结 2 1391
小鲜肉
小鲜肉 2021-02-13 17:35

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

2条回答
  •  死守一世寂寞
    2021-02-13 18:26

    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.

提交回复
热议问题