I am using System.Windows.Forms.RichTextBox and doing something like
RichTextBox1.Text = "Hello World";
But after this statement the cursor position of in the RichTextBox remains in the beginning. Is there any way to set it to the end?
This should do it for you:
RichTextBox1.Select(RichTextBox1.Text.Length - 1, 0);
Edit: If you have a lot of text in the textbox and which it to scroll the caret into view too, add this line:
RichTextBox1.ScrollToCaret();
See msdn for more.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With