I have 2 textbox, in one position and I show a text and in the other I enter a word, I look for it and I highlight it in the text. The texts are very long and not all, so that part of the text does not appear (use a scrollbar). I want to know if there is any way that if the word is not in the first visible lines go automatically to where the searched word is.
I use this to search and highlight:
public void ResaltarTexto(TextBox txtBx, string texto)
{
int posición = txtBx.Text.IndexOf(texto);
txtBx.Focus();
txtBx.SelectionStart = posición;
txtBx.SelectionLength = texto.Length;
}