Q:

How do I add text to the location of a user's cursor in a Rich Text Box in C#?

In Visual C#.NET:
How do I add/append text directly to where the user's cursor is in a Rich Text Box?
For example, if the user clicked a button, and their cursor was somewhere in the rich text box, text would be immediately added to the location of their cursor.

A:

Use the SelectedText property:
textBox.SelectedText = "New text";

This will overwrite any selected text they have though. If you don't want that you can first set the SelectionLength property to 0:
textBox.SelectionLength = 0;
textBox.SelectedText = "New text";

A:

     rtb.SelectionStart += rtb.SelectionLength;
     rtb.SelectionLength = 0;
     rtb.SelectedText = "asdf";

This moves the cursor just past the end of the current selection, then adds "asdf" at the end.

