Quantcast
Channel: Windows Desktop Development for Accessibility and Automation forum
Viewing all articles
Browse latest Browse all 585

System.windows.controls.Richtextbox control doesn't persist carriage return (Enter "\v") symbol

$
0
0

Hi,

In our application, we are using Richtextbox from system.windows.controls as content control to store formatted text. When we retrieve formatted text from this content control it doesn't returning us formatted text (skipping carriage return symbol).

To retrieve text from content control we are using below code,

rtb as RichTextBox

Code Snippet 1 -  

rtb.SelectAll();

rtb.Selection.Text;

Code Snippet 2 -

TextRange textRange = new TextRange(

         rtb.Document.ContentStart,

         rtb.Document.ContentEnd);

textRange.Text;

Can you please let me know how to retrieve formatted text (with carriage return) from Rich text box control.

Regards,

Nitesh Gat


Viewing all articles
Browse latest Browse all 585

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>