search in richtextbox

The solution for “search in richtextbox” can be found here. The following code will assist you in solving the problem.

Dim index As Integer = 0

‘TextBox1 = text to be searched in the rich text box
‘RichTextBox1 = text being searched

While index < RichTextBox1.Text.LastIndexOf(TextBox1.Text) RichTextBox1.Find(TextBox1.Text, index, RichTextBox1.TextLength, RichTextBoxFinds.None) RichTextBox1.SelectionBackColor = Color.Turquoise index = RichTextBox1.Text.IndexOf(TextBox1.Text, index) + 1 End While

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

Similar Posts