Clyde Eisenbeis

Clyde Eisenbeis

  • 1.7k
  • 63
  • 11.9k

How do I delete the contents of a RichTextBox and add new co

Feb 19 2015 7:38 PM
How do I delete the contents of a RichTextBox and add new contents?

I am retrieving multiple sections of data from a database. The RichTextBox displays the first section from the database.

The customer hits the Next button ... the RichTextBox should display the second section from the database. The following code concatenates the second section to the first section.

gRTbx.Document.Blocks.Clear();

gobjParagaph.Inlines.Add(new Run(st));
gobjFlowDoc.Blocks.Add(gobjParagaph);
gRTbx.Document = gobjFlowDoc;

I also tried placing this before adding to the RichTextBox.

gobjFlowDoc.Blocks.Clear();

How do I remove the first section from the RichTextBox ... then display the second section?

Answers (1)