473,473 Members | 2,167 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

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
Nov 20 '05 #1
1 5069
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.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Benny Raymond" <be***@pocketrocks.com> wrote in message
news:ev*************@TK2MSFTNGP11.phx.gbl...
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

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Thomas Kehl | last post by:
Hi! I have a RichTextBox. I set the Property RightMargin of this Box to a value, that i will not show the horizontal scrollbar. Now, the RichTextBox Wrap the Lines automatically. Now I would...
3
by: kangoo | last post by:
Hi, I'm trying to remove the last charater in a richTextBox. I though richTextBox.Text.Remove(richTextBox.Text.length-1, 1); would work, but it does nothing (eg richTextBox.Text += "some new...
4
by: Peter Row | last post by:
Hi, I have created a UserControl which is subsequently hosted on a standard form. My control has a TabControl on it but it has no TabPages configured. At runtime I create X pages and put a...
2
by: Thorsten moeller | last post by:
Hi, i have a Textbox and amethod adding lines to the Textbox. There are two kind lines, depending on a check to be valid or invalid. Is it possible to color the lines or the text in a textbox...
0
by: OmniTech via .NET 247 | last post by:
I am having trouble updating lines in a richtextbox. The rtb.lines.setvalue("text", linenumber) runs, but does not update the control in the form. The code follows... This apps automatically...
2
by: None | last post by:
How do i write lines with different colors in a textbox? I've tried using the forecolor property and it just takes the last color. eg. TextBox1.ForeColor = Color.Red TextBox1.Text = "test" & "...
3
by: michael sorens | last post by:
The documentation for the RichTextBox is sketchy at best. I want to do a very simple task but I cannot find information on this. I am using a RichTextBox as an output window. Some text I want to...
0
by: anupam roy | last post by:
Hi, I have created my own XML text editor and using XmlReader to read the xml files I have opened one xml file for editing in the text box editor( i have . Now before saving the file, i want to...
3
by: booyeeka | last post by:
on a windows form, i have RichTextBox, with some text, in several lines. and one button on a form. i wolud like when i click on that button, to join all richtextbox of lines in one line, but not...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.