TextPointer pointer = myRichTextBox.CaretPosition.GetNextInsertionPosition(LogicalDirection.Forward); string value = pointer.GetValue(typeof(string)).ToString();
TextPointer pointer = myRichTextBox.CaretPosition.GetNextInsertionPosition(LogicalDirection.Forward); Inline inline = pointer.GetValue(typeof(Inline)) as Inline;In this example, the Inline element at the TextPointer is retrieved using GetValue method and cast to an Inline type. It is also part of the WPF library. Overall, ITextPointer.GetValue is a useful method for retrieving the value of a text container at a specific location in a document or text block.