void updateMatches(int increment) { matches = FindAndReplace.Find(textBox.Text, txtFindText.Text, chkMatchCase.Checked, chkWholeWordsOnly.Checked); if (increment != 1 && increment != 0 && increment != -1) { throw (new ArgumentException()); } index += increment; position = matches[index]; if (matches.Count == 0) { lblMatchesFound.Text = "No matches found."; } else if (matches.Count == 1) { lblMatchesFound.Text = "1 match found."; } else { lblMatchesFound.Text = matches.Count + " matches found."; } }