This is a migrated thread and some comments may be shown as answers.

SelectionStart and SelectionColor in RadRichTextEditor

1 Answer 117 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
joshua
Top achievements
Rank 1
joshua asked on 20 Nov 2015, 01:59 PM

Hi,

I am new in here. I hope someone will help me.I'm writing this peace of code to check if the inputted text are correct and change the color my text if it is wrong

My error is on SelectionStart and SelectionColor

Please see below my code

Private Sub RadRichTextEditor1_TextChanged(sender As Object, e As EventArgs) Handles RadRichTextEditor1.TextChanged
       Dim ValuetoCheck= RadRichTextEditor2.Text
       Dim ArrayValue() As String = W.Split(" ")
         For Each searchword As String In ValuetoCheck
           Dim index As Integer = 0
           While index <> -1
               index = RadRichTextEditor1.Text.IndexOf(searchword, index)
               If index <> -1 Then
                   If index = RadRichTextEditor1.Text.Length - searchword.Length - 1 Then
                       RadRichTextEditor1.SelectionStart = index
                       RichTRadRichTextEditor1extBox1.SelectionLength = searchword.Length
                       RadRichTextEditor1.SelectionColor = Color.Black
                       RadRichTextEditor1.SelectionStart = RadRichTextEditor1.Text.Length
                       Exit Sub
                   Else
                       index += 1
                   End If
               Else
                   RadRichTextEditor1.SelectionStart = n
                   RadRichTextEditor1.SelectionColor = Color.Red
               End If
           End While
       Next ' added
   End Sub

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 24 Nov 2015, 01:58 PM
Hi  Joshua,

Thank you for writing.

The RadRichTextEditor does not work like a regular textbox. So its Text property is only inherited and should not be used. To retrieve the text you can use one of the format providers. Detailed information about how this control works is available in the following articles:
In addition, the control supports spell checking out of the box: Spellcheck.

Let me know if you have additional questions.

Regards,
Dimitar
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
joshua
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or