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.
我正在寻找以编程方式滚动富文本框的 C#.net 代码,我已经搜索过它,但我找到了一些 VB.Net 示例,但不知道如何使用它们。任何帮助将不胜感激。提前致谢 :)
如果我正确理解,您希望在向此控件添加新行后将richtextbox 滚动到底部。只需将此代码添加到每次添加一些新数据时运行的方法中:
private void AddText(string text) { richTextBox1.AppendText(text + Environment.NewLine); richTextBox1.SelectionStart = richTextBox1.Text.Length; richTextBox1.ScrollToCaret(); }