473,388 Members | 1,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

[VB.NET 2005] limiting the lines of text in a richtextbox control

Hi
I am writing an application that uses a RTB as an event log that
writes each event in a new line under the last event.. I only want to
store about 100 lines of events so the log doesn't grow too large or
exceed any limits, but I can't figure out how to put that limit into
place.

So as new events are logged, I want to be able to remove the old
events so the line limit is maintained at 100.

I someone please give me some hints on how that might be achieved?

many thanks... :D

paul.

Jul 26 '07 #1
1 2317

"plonk" <pl***@orcon.net.nzwrote in message
news:11*********************@z24g2000prh.googlegro ups.com...
Hi
I am writing an application that uses a RTB as an event log that
writes each event in a new line under the last event.. I only want to
store about 100 lines of events so the log doesn't grow too large or
exceed any limits, but I can't figure out how to put that limit into
place.

So as new events are logged, I want to be able to remove the old
events so the line limit is maintained at 100.

I someone please give me some hints on how that might be achieved?

many thanks... :D

paul.
bah. I figured it out..

a bit untidy but it works great :D

txtCount += 1
If txtCount = 100 Then
myEventLog.SelectionStart = 0
myEventLog.SelectionLength = myEventLog.Text.IndexOf(Chr(10), 0) + 1
myEventLog.SelectedText = ""
txtCount -= 1
End If

Jul 26 '07 #2

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

Similar topics

3
by: Nick Haines | last post by:
I need to write my own custom text edit control.. but I'm not sure where to start - I've never written a custom control... the features I want are somewhat similar to the VS .Net text editor - text...
2
by: Surajit Laha | last post by:
Hi, Can I put a RichTextBox Control in a WebForm? My objective is: User pastes a scren shot (for online problem solving) and then submits, it gets saved in the DB. An expert looks into this...
3
by: jman3 | last post by:
I have a richtextbox control and I am adding several lines of text to it. I am trying to make it so that any text that starts with "*" is bolded, and that all other lines are kept in regular...
4
by: Juan Romero | last post by:
Hey guys, Does anyone know how to find out the visible lines in the richtextbox control? For example, let's say the control has 30 lines, but due to size it can only display 10. The current...
0
by: John Bowman | last post by:
Hi All, I've got a RichTextBox control that has some variable length & language text in it that was retrieved from a resource file. When the text gets long enough the control automatically...
2
by: Ludwig | last post by:
Hi, thanks to the insight that Kevin Spencer gave me concerning my regular expressions question from a few days ago, I managed to create a first version of my (free) Highlighter RichTextBox...
1
by: Jesper | last post by:
Hi, In a RichTextBox control I've have set the properties mulitline = true, scrolbars.Both How can I query a RichTextBox control for showing the vertical scroll bar - i.e. query the RTB for...
0
by: shivaranjaniadimulam21 | last post by:
Hello, I need to implement an email editor control in my application. The control should allow me to type in text in any format,font etc. This i have managed using the richtextbox control...
1
by: Nilam2477 | last post by:
I have RichTextBox control. I want to save the text in a stack for Undo operation each time user changes/updates the Text. I dont to want to use TextBox Base Undo functionality bec i have other...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.