如何使自动滚动多行TextBox中的WinForms?TextBox、WinForms

由网友(英雄太迷人)分享简介:可能重复: How我自动滚动多行文本框的底部? 我用的是多行文本框来输出新线的一些信息,因为它从到达一个的BackgroundWorker 。I use a multiline TextBox to output some information in new lines as it arrives from a...

可能重复:   How我自动滚动多行文本框的底部?

我用的是多行文本框来输出新线的一些信息,因为它从到达一个的BackgroundWorker

I use a multiline TextBox to output some information in new lines as it arrives from a BackgroundWorker.

我可以把它给每个新线到达时滚动至最底部?

Can I make it to scroll to the very bottom each time a new line arrives?

在默认情况下它似乎做的正好相反 - 每一个新行到达时,它滚动到第一行的文本属性更改

By default it seems to do just the opposite - it scrolls to the very first line each time a new line arrives and the Text property is changed.

推荐答案

将文本属性:

多= TRUE 滚动条=两个

Multiline = True ScrollBars = Both

要自动滚屏上的框TextChanged 事件:

textBox1.SelectionStart = textBox1.Text.Length;
textBox1.ScrollToCaret();
阅读全文

相关推荐

最新文章