Open generated web page with a WebBrowser object in VB

I would like to know if it is possible to display an HTML page created in VB using a WebBrowser object without using files on disk. That is, create an HTML file in memory and display it in a WebBrowser object. Thanks!

+7
source share
3 answers

Well, I found a solution. It is not that difficult. The solution is to run from VB: *

  • WebBrowserObject.Navigate "about: HTML TEXT"
  • It works, I checked it.
0
source

Using Visual Basic in the .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 
+4
source

First, wait for the DocumentComplete event (go to: blank if you are starting from scratch), then use document IPersistMoniker (recommended if you want to provide a base url) or the IPersistStreamInit interface to load HTML content .

You can find an example in the csexwb project (LoadHtmlIntoBrowser method).

+2
source

All Articles