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