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. How to display the HTML content from XML in winforms [modified]

How to display the HTML content from XML in winforms [modified]

Scheduled Pinned Locked Moved C#
csharphtmlwinformsxmlhelp
5 Posts 3 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.
  • E Offline
    E Offline
    engsrini
    wrote on last edited by
    #1

    Hi, I have maintained html formatted text(help information) in XML file. like the following eg.

    **Login: ** Press login button to login into the page
    **View: ** Press View button to view the configuration details.
    ...

    So iam taking the contents of Node Page1 using XML document to display the help for Page1 in Richtext box. But Richtext box not recognizing HTML tags. It simply display the contents.. How to present this content. Is it possible with RTB or is there any controls to display this HTML formatted text. Thanks Srini -- modified at 14:46 Friday 2nd March, 2007

    E 1 Reply Last reply
    0
    • E engsrini

      Hi, I have maintained html formatted text(help information) in XML file. like the following eg.

      **Login: ** Press login button to login into the page
      **View: ** Press View button to view the configuration details.
      ...

      So iam taking the contents of Node Page1 using XML document to display the help for Page1 in Richtext box. But Richtext box not recognizing HTML tags. It simply display the contents.. How to present this content. Is it possible with RTB or is there any controls to display this HTML formatted text. Thanks Srini -- modified at 14:46 Friday 2nd March, 2007

      E Offline
      E Offline
      Edmundisme
      wrote on last edited by
      #2

      You can use the WebBrowser control to display html formatted text.

      E 1 Reply Last reply
      0
      • E Edmundisme

        You can use the WebBrowser control to display html formatted text.

        E Offline
        E Offline
        engsrini
        wrote on last edited by
        #3

        I can't use webbrowser..... since i am will only the text from XML. for displaying it in Webbrowser...we need to put into a separate HTML file.. and have to direct the webbrowser to that file path.... that is tedious job... and the webbrowser is not a stable component.. Any other solution here.

        E T 2 Replies Last reply
        0
        • E engsrini

          I can't use webbrowser..... since i am will only the text from XML. for displaying it in Webbrowser...we need to put into a separate HTML file.. and have to direct the webbrowser to that file path.... that is tedious job... and the webbrowser is not a stable component.. Any other solution here.

          E Offline
          E Offline
          Edmundisme
          wrote on last edited by
          #4

          The RichTextBox control does not support HTML formatting. In order to display the formatted text, you need to convert the HTML to RTF, then set the RichTextBox.Rtf property to the converted text. The slick way to do it would be to create your own ICustomFormatter object that converts HTML markup to RTF, then pass it, along with your HTML string to StringBuilder.AppendFormat. I don't know of any other way to tackle this problem. I'm sure there is a myriad of conversion tools out there and quite possibly an article or two on that topic on CP. Sorry I don't have a better solution. Perhaps someone else does? Ian

          1 Reply Last reply
          0
          • E engsrini

            I can't use webbrowser..... since i am will only the text from XML. for displaying it in Webbrowser...we need to put into a separate HTML file.. and have to direct the webbrowser to that file path.... that is tedious job... and the webbrowser is not a stable component.. Any other solution here.

            T Offline
            T Offline
            theomed
            wrote on last edited by
            #5

            Try xmlDataSource

            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