I have a search textbox called "textBox3"
and richtextbox called "lRichTextB ox1"
I want to make a search function that when I write something to "textbox3" it will then search the text from "lRichTextBox1" .
what i have tried
But after it has found the text, it will then auto-scroll to that text. how is that done?
and richtextbox called "lRichTextB ox1"
I want to make a search function that when I write something to "textbox3" it will then search the text from "lRichTextBox1" .
what i have tried
Code:
private void button4_Click_2(object sender, EventArgs e)
{
int aindex = 0;
while (aindex <lRichTextBox1.Text.LastIndexOf(textBox3.Text))
{
lRichTextBox1.Find(textBox3.Text, aindex, lRichTextBox1.TextLength, RichTextBoxFinds.None);
lRichTextBox1.SelectionBackColor = Color.Blue;
aindex = lRichTextBox1.Text.IndexOf(textBox3.Text, aindex) + 1;
}
}
Comment