In WPF you can insert at the caret position using the CaretIndex property. However this seems to be missing in the Silverlight textbox control.
CaretIndex
Is it possible using a different technique?
I also had the same problem. I used the SelectionStart property.
private void QuotePrefixTextboxTextChanged(object sender, TextChangedEventArgs e) { var tb = (TextBox)sender; var caret = tb.SelectionStart; tb.Text = tb.Text.ToUpper(); tb.SelectionStart = caret; }
Try:-
myTextBox.Select(position, 0); myTextBox.SelectedText = "Content to insert";