Click to See Complete Forum and Search --> : Auto Scroll Down w/Text Box?
Mongoose
October 11th, 2001, 03:10 PM
If I add more and more text into a text box.. I want it to automatically scroll down to see the last information that was added. I've tried to do a SelStart being the last character but it doesn't work correctly.
Has anyone done something similar?
Let me know what you did :)
Thanks,
Jv
Andrew R.
October 11th, 2001, 05:48 PM
private Sub Text1_Change()
Text1.SetFocus
SendKeys "^{END}"
End Sub
The idea is to set focus to your text box and then imitate user typing Ctrl+End.
You can also remembe which control had focus before to be able reset it after.
John G Duffy
October 11th, 2001, 06:45 PM
I have no problem with keeping the last line added visible using this simple Program. just make sure you have MultiLine set to true
option Explicit
private Sub Command1_Click()
static ctr
Text1.Text = Text1.Text & "Now is the time " & ctr & vbCrLf
Text1.SelStart = len(Text1.Text)
ctr = ctr + 1
End Sub
John G
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.