Scrolling back up to the Top of a Textbox control

Hi, I'm using VB.NET2010, WinForms. I have a Form with a textbox, where I append some text to the textbox after parsing an external text file. That part works well.

However, once all the text is appended, the scroll-bar is all the way down at the bottom of the file. I'd like to have the scroll bar move to the top of the file, so the user doesn't have to scroll back up manually to begin viewing the file.

I tried  ScrollToCarrot(), but I'm not sure how to set the target "Carrot."

How would I do that or is there a better way?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

try set focus first then use scrolltocaret()


Open in new window

also, if that doesn't work for you,
use TextBox1.SelectionStart
kaufmed 👽Commented:
Try setting the SelectionStart:
this.textBox1.SelectionStart = 0;
this.textBox1.Focus();    // If necessary (e.g. user clicks button to scroll)

Open in new window

OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

Carlos VillegasFull Stack .NET DeveloperCommented:
In this way
        TextBox1.SelectionStart = 0

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kaufmed 👽Commented:

Of course, in VB, you'd use "Me", not "this"  : )
Mr_FulanoAuthor Commented:
Most accurate solution. It worked as is. Thanks
Carlos VillegasFull Stack .NET DeveloperCommented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.