This question is locked. New answers and comments are not allowed.
Hi.
I had a need to get the position of the cursor on a particular line in the RadRichTextBox. To do that, I added a selection from the start of the current line to the caret position, and got the length of the selected text, as follows:
Once I get that value (iCol), I want to clear the selection I just added. When I call Document.Selection.Clear(), it clears all selections. What this means is that if the user selectes text, that that selection is cleared along with my programmatic selection.
Is there a way to clear my programmatic selection without clearing the user's selection? Can I iterate through selections, for instance, and remove individual ones?
Thank you.
I had a need to get the position of the cursor on a particular line in the RadRichTextBox. To do that, I added a selection from the start of the current line to the caret position, and got the length of the selected text, as follows:
Dim
iCol As Integer = 1
Dim oCaretPos As DocumentPosition = oRadRTB.Document.CaretPosition
Dim oStartPos As DocumentPosition = New DocumentPosition(oCaretPos)
oStartPos.MoveToCurrentLineStart()
oRadRTB.Document.Selection.AddSelectionStart(oStartPos)
oRadRTB.Document.Selection.AddSelectionEnd(oCaretPos)
iCol = oRadRTB.Document.Selection.GetSelectedText().Length + 1
Once I get that value (iCol), I want to clear the selection I just added. When I call Document.Selection.Clear(), it clears all selections. What this means is that if the user selectes text, that that selection is cleared along with my programmatic selection.
Is there a way to clear my programmatic selection without clearing the user's selection? Can I iterate through selections, for instance, and remove individual ones?
Thank you.