RichTextBox richTextBox = new RichTextBox(); richTextBox.AppendText("Hello World!"); richTextBox.FontWeight = FontWeights.Bold;
RichTextBox richTextBox = new RichTextBox(); Paragraph para = new Paragraph(new Run("This is a paragraph.")); Hyperlink link = new Hyperlink(new Run("Click here!")); link.NavigateUri = new Uri("http://www.example.com/"); para.Inlines.Add(link); richTextBox.Document.Blocks.Add(para);This code creates a new RichTextBox control and adds a paragraph with a hyperlink in it. The hyperlink is set to navigate to http://www.example.com/ when clicked. The System.Windows.Controls RichTextBox belongs to the PresentationFramework assembly in the .NET Framework.