C#/WPF: interaction with web browser control?

跟風遠走 提交于 2019-12-12 05:49:21

问题


Is it possible to interact with the source code of a local or remote page in real time through the use of the WPF browser control.

A simple example of what I mean would be where the user can click a button that will bold the selected text. Sort of like a WYSIWYG HTML editor but using the browser control.

Is there a way to interact with the source code like this with the same power you have with JavaScript. Would one have to set up a system to parse the selected web page and then modify its code and then reopen the new code in the browser control to simulate the experience of real time editing?

Thanks


回答1:


You have full DOM access through the webbrowser control, so the answer is yes. However, the webbrowser control is not a wpf control but a winforms control, and in order to use it you would have to use the wpf winforms container control.



来源:https://stackoverflow.com/questions/1895008/c-wpf-interaction-with-web-browser-control

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!