Phylum Posted July 22, 2005 Posted July 22, 2005 I have a richtextbox on a form. A network stream keeps on providing it with text. Text is added to the bottom of the textbox and I keep the focus on the bottom line (default is to go back to the top of the textbox when text is added). What I need to do however is cut out text from the TOP of the textbox a certain amount of text once there is a certain amount of text in the control (you get memory overflows after a while). A) How do I tell how many lines of text are in my richtextbox? B) How do I trim lines of text from the top of the textbox? Quote
Machaira Posted July 22, 2005 Posted July 22, 2005 "lines" is a vague term when you're talking about a multi-line textbox. There's a Lines property that you can access: MessageBox.Show(TextBox1.Lines.GetLength(0)) However, this doesn't take into account lines that are wrapped, just lines with hard returns. It still might be usable for what you're doing though. Quote Here's what I'm up to.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.