I would like to replace a manually selected text in rvedit leaving the selection.
Actually, I select the text, use InsertText to replace the text. But, in this way, I loose the selection
Hope I was clear ....

I select with the mouse the words "performance vehicles"Sports cars are performance vehicles that provide driving satisfaction
(underline means selected)Sports cars are performance vehicles that provide driving satisfaction
but i would like to haveSports cars are stunning autos that provide driving satisfaction
Hope this is more clearSports cars are stunning autos that provide driving satisfaction
Code: Select all
int SelStart, SelLength, SelStartNew;
RVGetSelection(RichViewEdit1->TopLevelEditor, SelStart, SelLength);
if (SelLength<0)
SelStart -=SelLength;
RichViewEdit1->InsertText("aaaaaaaaaa", false);
SelStartNew = RVGetLinearCaretPos(RichViewEdit1->TopLevelEditor);
RVSetSelection(RichViewEdit1->TopLevelEditor, SelStart, SelStartNew-SelStart);