4

I have a bunch of HTML code that I need to display in a label/textbox in a windows app written in c#. It should be in such a way that the output shows the HTML formatted text, rather than the HTML code itself.

How can I do this?

abatishchev
  • 95,331
  • 80
  • 293
  • 426
Troyes234
  • 41
  • 1
  • 2

5 Answers5

3

Render your HTML in WebBrowser control. It has special events for document and you can iterate by tags like this Hope it will help you;)

Community
  • 1
  • 1
Edward83
  • 6,582
  • 14
  • 71
  • 102
1

Check out WebBrowser

Stefan P.
  • 9,451
  • 5
  • 27
  • 43
1

There's a web browser control using IE's rendering engine to display HTML content. You might as well be able to do some simple parsing yourself and use a RTF control but that way you will be rather restricted.

Mario
  • 34,518
  • 5
  • 56
  • 76
1

If WebBrowser doesn't suit your needs you can check out these libraries with HTML label/control support

Christopher Tarquini
  • 10,776
  • 15
  • 52
  • 73
0

The HTML Editor (a wrapper for MSHTML, the rendering portion of Internet Explorer) in read-only mode might be what you need.

EdoDodo
  • 8,090
  • 3
  • 22
  • 30