How to scroll the top of a text box after printing some text?

I print a lot of text in a text box and want it to scroll up after printing is complete. A.

+8
c # scroll textbox
source share
4 answers

Set SelectionStart = 0; for your textbox. See here on MSDN for SelectionStart . Then you can set SelectionLength = 1;

Then you can call ScrollToCaret .

+14
source share

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

+2
source share
 textbox.SelectionStart = 0; 

which works in Wpf and in WinForms applications

+1
source share

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

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

etc .. if necessary

+1
source share

All Articles