TextRange textRange = new TextRange(rtb.Document.ContentStart, rtb.Document.ContentEnd); string rtbContent = textRange.Text;
yourRichTextBox.AppendText("Successfully Sent...");
Mark This Response as Answer -- Chandu http://www.dotnetfunda.com/images/dnfmvp.gif
string _Text = new TextRange(richTextBox1.Document.ContentStart, richTextBox1.Document.ContentEnd).Text;
TextRange(richTextBox1.Document.ContentStart, richTextBox1.Document.ContentEnd).Text = "Successfully Sent";
richTextBox1.Document.Blocks.Clear();richTextBox1.Document.Blocks.Add(new Paragraph(new Run("Text")));
string richText = new TextRange(richTextBox1.Document.ContentStart, richTextBox1.Document.ContentEnd).Text;
string StringFromRichTextBox(RichTextBox rtb){ TextRange textRange = new TextRange( // TextPointer to the start of content in the RichTextBox. rtb.Document.ContentStart, // TextPointer to the end of content in the RichTextBox. rtb.Document.ContentEnd ); // The Text property on a TextRange object returns a string // representing the plain text content of the TextRange. return textRange.Text;}
Paragraph para = new Paragraph();para.Inlines.Add(new Run("Successfully Sent.."));FlowDocument fd = new FlowDocument(para);richTextBox1.Document = fd;
private void Form_Load(object sender, EventArgs e){ richText.AppendText("Hello, World!"); }
Login to post response