使用如下语句即可
this.textBoxLog.Focus();//获取焦点
this.textBoxLog.Select(this.textBoxLog.TextLength,0);//光标定位到文本最后
this.textBoxLog.ScrollToCaret();//滚动到光标处
本文介绍了如何通过C#代码实现获取文本框焦点、定位光标到文本末尾及滚动到光标位置的操作,适用于Windows应用程序开发。
使用如下语句即可
this.textBoxLog.Focus();//获取焦点
this.textBoxLog.Select(this.textBoxLog.TextLength,0);//光标定位到文本最后
this.textBoxLog.ScrollToCaret();//滚动到光标处
3083
1473
2538

被折叠的 条评论
为什么被折叠?