Skip to content

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

Clyde Eisenbeis

Asked Feb 19, 2015, 2:38 PM EST1 answer
Share
LinkedInX
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?

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    gobjParagaph.Inlines.Clear()
    gobjFlowDocs.Blocks.Clear()
    0