Hello Devs,

I am new to VB.net, and to this forum, so please be patient if I make any errors.

I have a problem with my code below. The RichTextBoxFinds.None doesn't seem to work.

I have a richtextbox (RichTxt_CV) and a textbox (txtFind_CV). I want the richtext box, to highlight any word in the txtfind_CV textbox, in Red.
This is almost working, but no matter what I try, I just can't get it to igore the CaSingG of the txtfind_Cv textbox. I think I have tried everything. Any suggestions?


Code:
    Private Sub HighlightCVText() 'This highlights the searched for word in the CV box
        If txtFind_CV.Text = "" Then GoTo endme
        Dim textEnd As Integer = RichTxt_CV.TextLength
        Dim Textindex As Integer = 0
        Dim lstIndex As Integer = RichTxt_CV.Text.LastIndexOf(txtFind_CV.Text)

        While Textindex < lstIndex
            RichTxt_CV.Find(txtFind_CV.Text, Textindex, textEnd, RichTextBoxFinds.None)
            RichTxt_CV.SelectionColor = Color.Red
            Dim bfont As New Font(RichTxt_CV.Font, FontStyle.Bold)
            RichTxt_CV.SelectionFont = bfont
            Textindex = RichTxt_CV.Text.IndexOf(txtFind_CV.Text, Textindex) + 1
        End While
endme:
    End Sub
Thanks so much in advance for your help.