Hi,
I am using the richtextbox selectionstart and selectionLength property for finding some text but its not working .
can anybody help me please ....

here is my code

Dim startPos As Integer
        Dim endPos As Integer
        RichTextBox8.Rtf = RichTextBox8.Rtf
        startPos = InStr(RichTextBox8.Rtf, "\objw") 
        endPos = InStr(RichTextBox8.Rtf, "\objh") 

        Dim startP As Integer = startPos
        Dim endp As Integer = endPos
        Dim totallen As Integer = endp - startP

        RichTextBox8.SelectionStart = startP
        RichTextBox8.SelectionLength = totallen

 

        TextBox11.Text = RichTextBox8.SelectedText
        RichTextBox9.Rtf = RichTextBox8.SelectedRtf

I am also use the richtextbox.Find () method but its not working.

Problem solved by finding the richtextbox data using find method use rtf data into textbox as rtf then use find() method.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.