Hi,
I want to insert some text in an ultratexteditor at the current caret position when a button is clicked. The problem is that the text is always pasted at the end. Im using ultratexteditor.paste() method. My apologies if this question is discussed before in the forum.
If you want to place text at the current cursor posiiton, I beleive you need to set the SelectedText property.
I have done following changes to resolve the issue.
string stringToInsert = "STRING TO INSERT";
ultraTextEditor1.AlwaysInEditMode = true;
int selectionStart = ultraTextEditor1.Editor.SelectionStart;
ultraTextEditor1.Text = ultraTextEditor1.Text.Insert(selectionStart, stringToInsert);
ultraTextEditor1.Editor.SelectionStart = selectionStart + stringToInsert.Length;