int textEnd = txtshowfile.TextLength; int index = 0; int lastIndex = txtshowfile.Text.LastIndexOf(txtsearchgerman.Text); while (index < lastIndex) { txtshowfile.Find(txtsearchgerman.Text, index, textEnd, RichTextBoxFinds.None); txtshowfile.SelectionBackColor = Color.Yellow; index = txtshowfile.Text.IndexOf(txtsearchgerman.Text, index) + 1; }
index
int index = 0; private void ReadNextLine() { ... }
int textEnd = txtshowfile.TextLength; int index = 1; int prevIndex = Convert.ToInt16( txtshowfile.Tag); int lastIndex = txtshowfile.Text.LastIndexOf(txtsearchgerman.Text); txtshowfile.SelectionBackColor = Color.White; prevIndex = txtshowfile.Text.IndexOf(txtsearchgerman.Text, prevIndex + 1); txtshowfile.Tag = prevIndex; index = prevIndex; if (prevIndex < 0) { index = 0; txtshowfile.Tag = 0; } txtshowfile.Find(txtsearchgerman.Text, index, textEnd, RichTextBoxFinds.None); txtshowfile.SelectionBackColor = Color.Yellow; index = txtshowfile.Text.IndexOf(txtsearchgerman.Text, index) + 1; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)