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.
我有一个 TextBox 或 RichTextBox
如何将插入符号移动到 TextBox 或 RichTextBox 中的最后一个索引?
要将插入符号移动到 TextBox 或 RichTextBox 中的最后一个索引,请使用以下代码:
对于文本框
TextBox1.SelectionStart = TextBox1.TextLength
对于富文本框
RichTextBox1.SelectionStart = RichTextBox1.TextLength