I am trying to add text one line at a time to a richtextbox.
I would like the new line to be added to the bottom of the RTB and the previous line to be moved up a line, to give the appearance of the text scrolling up to the top.
So far I have the following:
I am guessing it's something to do with the timer code.Code:Private Sub Form_Load() Dim myString As String Dim tmpArray() As String myString = "First line of text" & vbCrLf & vbCrLf & _ "Second line of text" & vbCrLf & vbCrLf & _ "Third line of text" & vbCrLf & _ "Fourth line of text" tmpArray() = Split(myString, vbCrLf) Timer1.Enabled = True End Sub Private Sub Timer1_Timer() Dim i As Long For i = 0 to Ubound(tmpArray) RichTextBox1.Textrtf = RichTextBox1.rtf & vbcrlf & tmpArray(i) Next i![]()




Reply With Quote