Gets the contents of the RichTextBox.
Assembly: System.Windows (in System.Windows.dll)
The following example shows how you can set content in a RichTextBox using XAML and code.
'A RichTextBox with intial content in it. Private Sub ContentRTB() 'Create a new RichTextBox with its VerticalScrollBarVisibility property set to Auto. Dim MyRTB As New RichTextBox() MyRTB.VerticalScrollBarVisibility = ScrollBarVisibility.Auto ' Create a Run of plain text and some bold text. Dim myRun1 As New Run() myRun1.Text = "A RichTextBox with " Dim myBold As New Bold() myBold.Inlines.Add("initial content ") Dim myRun2 As New Run() myRun2.Text = "in it." ' Create a paragraph and add the Run and Bold to it. Dim myParagraph As New Paragraph() myParagraph.Inlines.Add(myRun1) myParagraph.Inlines.Add(myBold) myParagraph.Inlines.Add(myRun2) ' Add the paragraph to the RichTextBox. MyRTB.Blocks.Add(myParagraph) 'Add the RichTextBox to the StackPanel. MySP.Children.Add(MyRTB) End Sub
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.