Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Preview html code...

Preview html code...

Scheduled Pinned Locked Moved C#
questionhtml
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    simplicitylabs
    wrote on last edited by
    #1

    I want to preview html code in my windows form app using the web browser control, without saving the document. I just want to somehow capture the text/code in the textbox, and display it in the browser control. Anyone know how can I make this happen?

    R 1 Reply Last reply
    0
    • S simplicitylabs

      I want to preview html code in my windows form app using the web browser control, without saving the document. I just want to somehow capture the text/code in the textbox, and display it in the browser control. Anyone know how can I make this happen?

      R Offline
      R Offline
      Ravi Bhavnani
      wrote on last edited by
      #2

      Set the control's DocumentText property. /ravi

      This is your brain on Celcius Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

      S 1 Reply Last reply
      0
      • R Ravi Bhavnani

        Set the control's DocumentText property. /ravi

        This is your brain on Celcius Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

        S Offline
        S Offline
        simplicitylabs
        wrote on last edited by
        #3

        Thank you for your reply. However, I'm not sure how to set the control's Document.Text property. Could you offer some guidance? Thank you.

        R 1 Reply Last reply
        0
        • S simplicitylabs

          Thank you for your reply. However, I'm not sure how to set the control's Document.Text property. Could you offer some guidance? Thank you.

          R Offline
          R Offline
          Ravi Bhavnani
          wrote on last edited by
          #4

          WebBrowser _wb = new WebBrowser();
          _wb.DocumentText = "<html>Hello, <b>HTML</b>!";

          /ravi

          This is your brain on Celcius Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups