VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Auto-Scrolling TextBox

by Alexander Chia (3 Submissions)
Category: VB function enhancement
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (19 Votes)

A few lines of useful code to make a text box auto scroll to the bottom every time it changes. (like mIRC and msn)
Simply replace Text1 with the name of your textbox.
By Alex. (https://www.alexchia.com)

Rate Auto-Scrolling TextBox

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

Download this snippet    Add to My Saved Code

Auto-Scrolling TextBox Comments

No comments have been posted about Auto-Scrolling TextBox. Why not be the first to post a comment about Auto-Scrolling TextBox.

Post your comment

Subject:
Message:
0/1000 characters