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

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
Use the same property you have used in your sample
textBox1.SelectionStart = oldSelectionStart;
 
Back
Top