How to go about removing lines of text at the top of a RichTextBox

  • Thread starter Thread starter Benny Raymond
  • Start date Start date
B

Benny Raymond

I have lines of data coming from a server being written to a
RichTextBox... The problem is that if I let this program run for a long
period of time there are hundreds of lines of text showing up in the
RichTextBox..

How would I go about setting a buffer size that would remove old lines
as new ones are being added? Also, how can I do this without removing
the formatting in the box. (I tried to do some array manipulation and
replace the lines in the box but the formatting went away)

thanks!

Benny
 
Benny,

If you want to remove lines, you will have to actually take the text,
remove the first lines or so, and then set the text on the textbox back.

You might want to consider a grid or something with a list of items.
This way, you can remove the item from the bound data source, and it will
update accordingly.

Hope this helps.
 
Back
Top