Auto-Scrolling TextBox

By | 2002-06-01

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

Author: dwirch

Derek Wirch is a seasoned IT professional with an impressive career dating back to 1986. He brings a wealth of knowledge and hands-on experience that is invaluable to those embarking on their journey in the tech industry.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.