I am trying to find out a control that will parse HTML in C#. It should display background colors, and everything else.
I have tried a couple of controls:
Web Browser - Does NOT display the background color.
RichTextBox - Does NOT display HTML, it only shows the HTML code for example:
<HTML>
<BODY>
<FONT COLOR="#1开发者_JAVA百科23456">
HELLO
</FONT>
</BODY>
</HTML>
How would I get C# to parse the ENTIRE HTML contents, including the background color whether it changes every 30 seconds or not?
Maybe an HTML to RTF converted for the richtextbox control? And if so, how would I convert it?
The WebBrowser
control is quite literally the exactly same engine (Trident) as IE, so I question it when you say that it will not display background colors. The example you show above has no background color specified.
That being said, WPF Page
controls can display HTML just as though you where using a browser, given the correct configuration options. You would convert a normal Window
to a NavigationWindow
and then Navigate()
to the URI in question.
Start from the rich textbox and save the file as htm/html.
You can convert HTML to rtf and set it as Rtf Property. It is lot of work and you should do it only when you want to edit your HTML.
精彩评论