Pete's Windows, Office, VB & SQL Blog

Problems I have solved (or not) and good ideas I've found

How to scroll a textbox programatically as data is added

with one comment

This should be easy, but after some experimentation it appears at least this sequence is required:

textbox1.Text = textbox1.Text & sLine & Environment.NewLine  ‘ Add the data

textbox1.Focus() ‘ claim the focus

textbox1.SelectionStart = Len(textbox1.Text) – 1 ‘ set the Caret

textbox1.ScrollToCaret() ‘ move the view of the text box

textbox1.Refresh() ‘ display the view of the textbox.

This works while the application itself has focus.

Written by fisherpeter

2009 November 24 at 17:17

Posted in VB express 2005

Tagged with

One Response

Subscribe to comments with RSS.

  1. It is the best time to make some plans for the longer term and it’s time to be happy. I’ve read this post and if I may I want to recommend you some attention-grabbing issues or suggestions. Maybe you can write next articles regarding this article. I desire to learn even more things approximately it!


Leave a comment