如果我在 RTB 中添加一些文本,如何使其自动向下滚动?
目前我使用的方法是:
conversationRtb.Rtf = tab.conversationRtb.Rtf;
conversationRtb.SelectionStart = conversationRtb.Text.Length;
conversationRtb.ScrollToCaret();
但它的效果不是很好。有时它不能滚动到最底端,而是在倒数第二行停止。
有时它会造成很大的偏移量。
我找不到原因。有没有其他方法来滚动?我找到了
AutoScrollOffset
但没有关于如何使用它的示例。
User32.dll
来滚动。https://dev59.com/jF7Va4cB1Zd3GeqPJF4v http://www.dutton.me.uk/2011/08/31/richtextbox-scrolltocaret-bug/ - keyboardP