473,800 Members | 3,057 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

rich text maximum number of lines

hi....
Can anyone tell me plz how to set a maximum number of (lines) to a
rich text control and show only last linse when number of lines exceeds

the maximum number???

i've tried to use richtext.lines array to determine lines length but i
can remove from it cause its of system array type and is length fixed
which means i cant add or remove elements from it...
thx in advance

Apr 4 '06 #1
2 1923
Hello, Art,

Are you trying to do something like this?

Private mstraLines As String() = {"First Line"}

Private Sub Button1_Click(B yVal sender As System.Object, _
ByVal e As System.EventArg s) _
Handles Button1.Click

Const kinMaxLines = 4
Dim intTotalLineCou nt As Integer = UBound(mstraLin es) + 1
ReDim Preserve mstraLines(intT otalLineCount)
mstraLines(intT otalLineCount) = "This is new line # " & _
intTotalLineCou nt
intTotalLineCou nt = intTotalLineCou nt + 1
Dim intLinesToShow As Integer = intTotalLineCou nt
If (intLinesToShow > kinMaxLines) Then
intLinesToShow = kinMaxLines
End If
Dim intFirstLine As Integer = intTotalLineCou nt - intLinesToShow
Dim straLinesToShow (intLinesToShow - 1) As String

Array.Copy(mstr aLines, intFirstLine, _
straLinesToShow , 0, intLinesToShow)

RichTextBox1.Li nes = straLinesToShow

End Sub

Cheers,
Randy
Ar*********@gma il.com wrote:
hi....
Can anyone tell me plz how to set a maximum number of (lines) to a
rich text control and show only last linse when number of lines exceeds

the maximum number???

i've tried to use richtext.lines array to determine lines length but i
can remove from it cause its of system array type and is length fixed
which means i cant add or remove elements from it...
thx in advance

Apr 5 '06 #2
thanx alot R. MacDonald
your the man

Apr 9 '06 #3

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

Similar topics

4
5583
by: Terren | last post by:
I have a popup window that is used to display text from a database. Some times it can be a few words, sometimes it can be a hundred words. What I would like to do is resize the popup window to fit the text. Well actually it is just the height that needs to be resized. I have set the width to 600. I have put the text in a table and I was thinking I could set the height of the window to be the height of the table plus some for room. I...
1
7775
by: PC User | last post by:
I found this Rich Text Editor and I've been trying to recreate it in my own application. I've had trouble with the COMCTL.ImageListCtrl and the COMCTL.Toolbar to recreate the toolbar. And I've had trouble with COMCTL.SBarCtrl in recreating the status bar. Does anyone have any experience with these or know of any website that explaines how to use these? http://www.access-programmers.co.uk/forums/attachment.php?attachmentid=5545 ...
0
1106
by: David Killian Woods | last post by:
There are a couple of features I'd like for my scrollbars, but I'm not sure the best way to go about them. First, I'd like to build in a little padding at the bottom of my window. The idea is that the scrollbar will start working when the page is about 50% full, so that the user will always be able to scroll down and not get cramped at the bottom. Do you trick the scrollbar into thinking the page is bigger? Do you just tag on a some...
0
2455
by: ray well | last post by:
hi, my app has two parallel rich text boxes containing the same content in 2 different languages. the lines parallel each other, line #3 in english contains the same content as line #3 in french. i need the two boxes to syncronize, if someone scrolls and clicks on line 23 in the english side, it should scroll to line 23 in the french side, and the same from french to english.
7
11047
by: TheGanjaMan | last post by:
Hi people, I'm stuck on a problem and I was wondering if there was a way around: I'm trying to find the number of lines in a comma delimited text file. I have a progress bar that should display the progress of a text file that is being read into a DataGridView. I would like the progressbar to progress as the lines of data are being read. But to set the maximum value for the progress bar I would need to know the
1
1450
by: dbo | last post by:
I'm looking to output text to a rich text box. The number of characters and lines will always be different. I need the output to fill the whole rich text box everytime. How can I do this? Thanks Dan
4
3594
by: Stupid48 | last post by:
I'm trying to do a simple task but can't seem to find a solution. How do I read lines from a text file backwards. i.e. I want to select the last 20 lines of a text file and display them in order starting with the last line first..... Any assistance would be greatly appreciated.... Thanks, Chris
4
5485
by: Neil | last post by:
Just found out that the Microsoft Rich Textbox does not support full text justification, since it's based on Version 1.0 of the RichEdit Window Class, and full text justification is only available in versions 3.0 or later of the class. However, also just found out that the new Rich Text property in Access 2007 ALSO does not support full text justification! This seems incredible, that MS would create a brand new application, and not...
1
4226
by: littlealex | last post by:
IE6 not displaying text correctly - IE 7 & Firefox 3 are fine! Need some help with this as fairly new to CSS! In IE6 the text for the following page doesn't display properly - rather than being aligned to the top, along with the slideshow and link buttons, you have to scroll down to see the text - how can I make IE6 display correctly? http://geekarama.co.uk/new_home.html here is the code for new_home.html and following that the CSS...
0
9694
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9553
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9095
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6824
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5477
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5612
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4152
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3765
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2953
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.