Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi All,

The task should you decided to accept it to tell me why (in VB)
VB
txtActivityWindow.Text += "#SZ99 OK" + vbCrLf
txtActivityWindow.Refresh()
txtActivityWindow.ScrollToCaret()

Does not scroll up the textbox as it is filled with data???
(Yes the box is multi-lined) I seem to remember having this issue in C# and Scroll To Caret
fixed it!

Glenn
Posted

1 solution

Please try the following:

txtActivityWindow.SelectionLength = 0
txtActivityWindow.SelectionStart = tbMessage.Text.Length
txtActivityWindow.ScrollToCaret()

The first line unselects any selected text. The second line places the
selection at the end of the text. The last line scrolls to the selected point.

regs RonO.
 
Share this answer
 
v2
Comments
glennPattonWork3 16-Apr-14 11:59am    
Thanks, giving it a go now!
glennPattonWork3 16-Apr-14 12:07pm    
Working like a charm, thanks!!!
Sergey Alexandrovich Kryukov 16-Apr-14 14:28pm    
Right, 5ed.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900