Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我希望滚动条始终位于底部,但是每当我尝试这样做时,就像跳回顶部然后又跳到底部一样,我该如何停止或防止这种情况? 这是我到目前为止的代码:
rtbOutputText.SelectionStart = rtbOutputText.Text.Length; rtbOutputText.ScrollToCaret();
另外,当我在richtextbox中选择文本时,间距,上下,选择我没有选择的东西......
您还应该在 SelectionStart 之前添加 rtbOutputText.SelectionLength = 0。