How can I display a string representation of a html
document using a WebBrowser control on a windows form as
opposed to passing an URL to the Navigate method?
In this case you have to right click on your Toolbox -> Add/Remove Items ->
Com Components Tab -> Find Microsoft Web Browser Control -> Checkmark it ->
Okay -> then go to your toolbox and scroll down if needed and drag the
Microsoft web browser (earth icon) onto your form.
You will also need to add several references. Project -> Referenes -> Com
tab ->
Find Microsoft HTML Object Library and double click on it
You might also need a reference to AxBrowser. (It's been a while since i've
actually created this project).
In your References it should have an AxSHDocVW and or ShDocVw and
Microsoft.mshtml
Use this following code to set the InnerHTML value. The only thing to note
is that images and css and such will not be loaded. If you are familiar with
Javascript and CSS PreLaoders/Switchers you can use the same method if CSs
is vital to the case. But the below sample takes XML and an XSLT file and
returns HTML and sets the body's innerHTML to the HTML
The following is for C# but should be adaptable for almost any .NET langauge
easily.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.