简体   繁体   中英

C#/WPF: interaction with web browser control?

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM