Post routine
Makes a multi-line textbox into a scrolling textbox, chat-style.
Usage
post frmLogging.text1, "Text to Post"
Side Effects
Constant MAXCHARS must be declared at the top of the module. Do not exceed 50000 for MAXCHARS.
Const MAXCHARS = 5000
Public Sub Post(tbxEditBox As TextBox, sNewText As String)
sNewText = sNewText & vbCrLf
With tbxEditBox
If Len(sNewText) + Len(.Text) > MAXCHARS Then
''Scroll some text off the top to make more room
.Text = Mid$(.Text, InStr(100 + Len(sNewText), .Text, vbCrLf) + 2)
End If
.SelStart = Len(.Text)
.SelText = sNewText
End With
DoEvents
End Sub
About this post
Posted: 2008-03-03
By: FortyPoundHead
Viewed: 2,722 times
Categories
Tutorials
Windows
Visual Basic 6
Attachments
Loading Comments ...
Comments
No comments have been added for this post.
Sorry. Comments are frozen for this article. If you have a question or comment that relates to this article, please post it in the appropriate forum.