Multiline textbox help

Hi All,
I have a textbox with the multiline property set to true. I am using the text box to display the general time every two seconds.
  My problem is that when I have the text box completely filled with time status info, I can't seem to see the time info after that point. I tried adding a vertical scroll bar, but that just moved the scroll bar up during runtime and the latest time was not available to the user.
  Ideally, once the text box is filled with info(up to the last line), I would like to have the first line of the textbox disappear,move rest of the data up by a line, so that there is one line of space at the bottom for the next time info. This way, I can always see the latest time status(real time) at the last line of the textbox.

I hope I was clear in explaining my problem.

Following is the code. I have a textbox placed on a form, its multiline property set to true, I have a timer in the form with an interval of 2 seconds, and I am trying to display the general time every 2 seconds.

Private Sub Timer1_Timer()
Text1 = Text1 & Format(Now, "General Date") & vbCrLf
End Sub

Thanks for the help
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

tzachariAuthor Commented:
Edited text of question.
You could add this to code

Text1.SelStart = Len(Text1)
Also, you might try a list box, it may be faster.

After adding you latest time, set selected(index) to true where index is the number of item you just added. (index) is zero based.

For i = 1 To 1000
    List1.AddItem i
    List1.Selected(i - 1) = True
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

Why wait to fill the text box...
add a counter and increment it every time you add a line when it reaches 100 or whatever clear the text up to the last line and start over.

Private Sub Timer1_Timer()

dim intCounter as integer

Text1 = Text1 & Format(Now, "General Date") & vbCrLf

intCounter = intCounter + 1
if intcounter = 100 then
text1.SelStart = 0
text1.SelLength = Len(text1.text)
text1.text = Format(Now, "General Date") & vbCrLf
End If

End Sub

vbWayne... no need for all of this:

text1.SelStart = 0
text1.SelLength = Len(text1.text)
text1.text = Format(Now, "General Date") & vbCrLf

Just use:

Text1 = Format(Now, "General Date") & vbCrLf
this code here works in vb6 but you must set the value of myMax to the number of lines

Const myMax As Integer = 5
Dim myNOE As Integer

Private Sub Timer1_Timer()
    Text1.Text = Text1.Text & Format(Now, "General Date") & vbCrLf
    GenreArray = Split(Text1.Text, Chr(13))
    myNOE = myNOE + 1
    If myNOE > myMax Then
        Text1.Text = ""
        For a = 1 To myMax
            Text1.Text = Text1.Text & Right(GenreArray(a), Len(GenreArray(a)) - 1) & vbCrLf
        Next a
    End If
End Sub

try it.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.