WPF new Block on WordWrap

Viewed 30

Is there a way to add a new Block on End of a RichTextBox in WPF? With the RichTextBox.Document.MaxPageWidth no new block are created...

RichTextBoxSample

Convert the RichTextBox Content to Text:

if (rtb.Document != null)
            {
                TextRange textRange = new TextRange(                    
                    rtb.Document.ContentStart,                    
                    rtb.Document.ContentEnd
                );

                var currentLine = textRange.Text;
                //Result:
                //" thisText ist new textwith textwrap and here no new line after MaxPageWidth only is here\r\nafter press SHIFT+ENTER a new Line :(\r\n"
                return textRange.Text;
            }

is there a way to add \r\n after wordWrap e.g. after the "and" ?

0 Answers
Related