Tools Links Login

Auto-Scrolling TextBox

Have you ever wanted an auto-scrolling text box? (U know, in MIRC and ICQ, the textbox scrolls by itself!) Here it is! Few lines, optimized and easy to use! If you have the higher versions of VB, you should set the textbox's Locked Property to True, unless you want to make the textbox editable.
'[Replace Text1 with the name of your textbox]
Thanx for viewing! :)

Original Author: unknown

Code

Private Sub Text1_Change()
  On Error Resume Next
  Text1.SelLength = 0
  If Len(Text1.Text) > 0 Then
   If Right$(Text1.Text,1) = vbCrLf Then
     Text1.SelStart = Len(Text1.Text) - 1
     Exit Sub
   End If
   Text1.SelStart = Len(Text1.Text)
  End If
End Sub

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 92 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.