如何在WinForms中制作自动滚动多行TextBox?

Iva*_*van 18 .net c# textbox winforms

可能重复:
如何自动滚动到多行文本框的底部?

我使用多行TextBox来输出新行中的一些信息BackgroundWorker.

每次新线路到达时,我可以将其滚动到最底部吗?

默认情况下,它似乎恰恰相反 - 每次新行到达并且Text属性发生更改时,它会滚动到第一行.

pat*_*hoi 43

设置TextBox属性:

Multiline = True;
ScrollBars = Both;
Run Code Online (Sandbox Code Playgroud)

要自动滚动TextChanged事件:

textBox1.SelectionStart = textBox1.Text.Length;
textBox1.ScrollToCaret();
Run Code Online (Sandbox Code Playgroud)