Reputation: 977
I'd like to know if it possible to show HTML page created in VB using WebBrowser object without using files on disk. That is, create HTML file in memory and show it within WebBrowser object. Thanks!
Upvotes: 7
Views: 5486
Reputation: 15271
First wait for the DocumentComplete event (navigate to about:blank if you start from scratch), then use the document's IPersistMoniker (recommended if you want to provide a base url) or IPersistStreamInit interface to load HTML content.
You can find an example (the LoadHtmlIntoBrowser method) in the csexwb project.
Upvotes: 2
Reputation: 2576
Using Visual Basic in .Net Framework...
webBrowser1.DocumentText = "<html><body><a href='http://www.mywebsite.com'>My Web Site</a></body></html>"
In old Visual Basic 6, try...
WebBrowser1.Document.Open
WebBrowser1.Document.Write "<html><body><a href='http://www.mywebsite.com'>My Web Site</a></body></html>"
WebBrowser1.Document.Close
Upvotes: 4
Reputation: 977
Well, I've found the solution. It's not so complicated. The solution is to run from the VB: *
Upvotes: 0