How can I scroll to the top of my textbox after printing some text to it?

10,084

Solution 1

textbox.SelectionStart = 0;

that works in Wpf and in WinForms Applications

Solution 2

For WinForms, use a combination of SelectionStart = 0 and ScrollToCaret()

Solution 3

Just use navigation keys after making sure the control has focus:

SendKeys.Send("^({HOME})");
SendKeys.Send("^({END})"); 

etc. as needed

Share:
10,084
abw333
Author by

abw333

Entrepreneur / Web + Mobile Developer / MIT Undergraduate Student

Updated on July 17, 2022

Comments

  • abw333
    abw333 almost 2 years

    I am printing a lot of text to a textbox and would like it to scroll to the top after the printing is complete.