TextSelection.Insert Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Inserts or replaces the content at the current selection as a TextElement.
Assembly: System.Windows (in System.Windows.dll)
Parameters
- element
- Type: System.Windows.Documents.TextElement
The TextElement to be inserted.
The following example uses the Insert method to insert a Run element into the RichTextBox.
<RichTextBox Name="MyRTB1" Width="150" Height="30" Margin="5"/> <Button Click="MyButton1_Click" Content="Insert Text" Height="23" Name="MyButton1" Width="75" />
Show: