how to display a web page (in windows application) from an html string ?

  • Thread starter Thread starter Herfried K. Wagner [MVP]
  • Start date Start date
You don't even have to save it to disk if you navigate to a blank document
first.
Use the WebBrowser control as Herfried suggested except browse to
about:blank first. Then use the document.Write moehod of the webbrowser
control to add your html string. Don't worry if intellisense doesn't display
any methods.

Me.myBrowser.Navigate2("about:blank")
Me.myBrowser.Document.Write("<HTML><BODY>HELLO WORLD</BODY></HTML>")
 
Hi,

i have some html string and i would like to display it like the web browser
does.

what is the best way to do it ?

Best Regards ,

Tiraman :-)
 
Cool!

Jared said:
You don't even have to save it to disk if you navigate to a blank document
first.
Use the WebBrowser control as Herfried suggested except browse to
about:blank first. Then use the document.Write moehod of the webbrowser
control to add your html string. Don't worry if intellisense doesn't display
any methods.

Me.myBrowser.Navigate2("about:blank")
Me.myBrowser.Document.Write("<HTML><BODY>HELLO WORLD</BODY></HTML>")
 
Hi.

I just found this post while having a similar problem. This solution
works for me also, *if I can also set the LocationURL property*. This is
because my string may have references to relative paths (for example
<form action="/someurl">). The hyperlink won't work unless the location
is the right one, or I make a method to replace all the relative paths
for absolute ones. Any suggestions?

TIA,
Manuel Ricca
 
You can use the html BASE tag with absolute path, and all other links
can stay relative.

Atara.
 
Back
Top