HTML viewer using AxWebBrowser and IHTMLDocument2

来源:互联网 发布:淘宝怎么自己开直播间 编辑:程序博客网 时间:2024/06/05 11:46

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.

原创粉丝点击