« SQL identity columns and SCOPE_IDENTITY vs. @@IDENTITY, Rowguids | Main | Control Rendering »

HTML viewer using AxWebBrowser and IHTMLDocument2

To send a string to the web browse control, you may want to go through the steps below:

1. Add a reference to the Microsoft HTML Object Library.

2. When form loads, use AxWebBrowser.Navigate method to navigate to "about:blank". (This way a new HTML Document is created.)

3. Make sure the document is loaded. (The DocumentCompleteEvent shows this.)

4. Get the AxWebBrowser.Document object and cast it to mshtml.IHTMLDocument2.

5. Set IHTMLDocument2.body.innerHTML property to the HTML string.

Comments

simple and str8forward..



thanks :o)

This is exactly what I was looking for. Simple, concise, and it works perfectly.



Thanks!

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)