Using GetLineStartPosition to get the end of a line in WPF RichTextBox.

Posted by Alan Spark on Stack Overflow See other posts from Stack Overflow or by Alan Spark
Published on 2010-06-17T08:37:59Z Indexed on 2010/06/17 12:43 UTC
Read the original article Hit count: 190

Filed under:
|
|

A bit of background. I would like to be able to process text for the line that the caret is on in a WPF RichTextBox. Please see my earlier question about the TextPointer class: http://stackoverflow.com/questions/3046162/how-to-keep-track-of-textpointer-in-wpf-richtextbox.

I know how to get the TextPointer at the start of the current line by using GetLineStartPosition with 0 as the argument but would now like to get the TextPointer at the end of the line. It was suggested in my previous question that this is possible using the GetLineStartPosition method.

I would appreciate it if someone can explain a bit about how the GetLineStartPosition works with regard to end of line pointers.

Thanks in advance for any help.

© Stack Overflow or respective owner

Related posts about c#

Related posts about wpf