How to set cursor location in a rich textbox for windows froms

G

Guest

I am having trouble with the cursor in a richtextbox for windows forms. After
incerting a character between words in a sentence, as so:

this.richTextBox1.Text =
this.richTextBox1.Text.Insert(this.richTextBox1.SelectionStart, ""+'\u1200');

Than the curser moves to the beginning of the textbox unabeling the user to
continue to insert characters or words where it was origanelly slected.

My solution to this is to get the cursor back to the location of where the
user first incerted the first character. How do I set the cursor location?
 
L

Lebesgue

Use the same property you have used in your sample
textBox1.SelectionStart = oldSelectionStart;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top