Set RTF text into WPF RichTextBox control

Do you really have to start with a string? One method to load RTF is this: rtfBox.Selection.Load(myStream, DataFormats.Rtf); You probably should call SelectAll() before that if you want to replace existing text. So, worst case, you’ll have to write your string to a MemoryStream and then feed that stream to the Load() method. Don’t forget … Read more

How can I make a hyperlink work in a RichTextBox?

Make sure the text property includes a valid url. E.g. http://www.stackoverflow.com/ set the DetectUrls property to true Write an event handler for the LinkClicked event. Personally, I wouldn’t pass “IExplore.exe” in as a parameter to the Process.Start call as Microsoft advise as this presupposes that it is installed, and is the user’s preferred browser. If … Read more

tech