I'm setting html text with tags to richtextbox but it's not displaing in correct format. Is there a way to show it in correct format?
2 Answers
RichTextBox control in WPF doesn't support HTML tag. It's clearly stated in MSDN Library.
Pasting HTML content into a RichTextBox might result in unexpected behavior because RichTextBox uses RTF format rather than directly using HTML format.
See this in .NET 3.0 and 3.5: http://msdn.microsoft.com/en-us/library/system.windows.controls.richtextbox(v=VS.90).aspx
And also this link in .NET 4.0: http://msdn.microsoft.com/en-us/library/system.windows.controls.richtextbox(v=VS.100).aspx
Comments
Please use Frame WPF control to display HTML correctly. If you have a stream of HTML text then use WebBrowser control. WPF Web Browser using NavigateToStream() and changing "about:blank" in printout