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
  • 98,240
  • 88
  • 296
  • 433
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,664
  • 14
  • 74
  • 102
1

Check out WebBrowser

Stefan P.
  • 9,489
  • 6
  • 29
  • 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
  • 35,726
  • 5
  • 62
  • 78
1

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

Christopher Tarquini
  • 11,176
  • 16
  • 55
  • 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,220
  • 3
  • 24
  • 30