1 Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click 2 RichTextBox1.SelectionStart = RichTextBox1.Text.IndexOf(RichTextBox1.Lines(Label1.Text)) 'Sets the selection 3 length as the length of the line 3. At this point, we have now set the start and end positions of the selection. 4 RichTextBox1.SelectionLength = RichTextBox1.Lines(Label1.Text).Length 5 RichTextBox1.SelectionColor = Color.Green 'Sets the color of the selected text to Green. 6 7 End Sub
Message=Index was outside the bounds of the array.
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE