Display HTML string in WebBrowser control

Welcome to Wisej Support.
Questions, suggestions and plain old bugs - are all welcome here!
0
0

Hi

I am trying to display some HTML in a WebBrowser control, however, I cannot seem to figure out how to achieve this.

Basically I am after something like this

webBrowser1.html = “<html><head><title>Test Title</title></head><body bgcolor = “#ffffcc” text = “#000000″><h1>Hello, World!</h1><p>You can modify the text in the box to e ft any way you like.</p></body></html>”

Clearly the “html” bit is wrong in the above code.  Anyone any idea’s how I can make this happen, I would have thought this would be very simple.

Thanks

Steve.

  • You must to post comments
0
0

Hi Steve,

The WebBrowser control doesn’t have the Html property, it’s meant to be used to browse a Url since it’s an IFrame on the client.

With Wisej you can display HTML in any control that can show text: label, button, combobox, radiobutton, etc. It’s enough to set AllowHtml = true and the Text property will accept HTML code. We also have the HtmlPanel control that has the Html property that you can assign with html text, or the HtmlSource property that you can assign to an html file in your application.

HTH

/Luca

 

  • You must to post comments
0
0

Check your quote types.  In your body tag, you have a left-double-quotation mark opener and ASCII double quotation marks closing it. In VB.net , that line would not work without single-quotes  (ie, apostrophe) because double-quotes are string terminators.

  • You must to post comments
Showing 2 results
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Attachment
File Name Size
There are currently no files uploaded.
Maximum number of files 1, maximum file size 3.9MB.
Supported file formats: zip pdf gif jpg bmp png cs vb theme json