0

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?

1
  • What have you given so far? Show us some sample. Commented Oct 28, 2011 at 5:17

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

Comments

1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.