public void Find()
{
int pos;
pos = txtPage.Find(SearchString, txtPage.SelectionStart + txtPage.SelectionLength, FindOptions);
if (pos == -1 & txtPage.SelectionStart > 0)
{
if (MessageBox.Show("You have reached the end of the document, start search at the beginning of the document?", "End of Document", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
txtPage.SelectionStart = 0;
Find();
}
}
else if (pos == -1)
{
MessageBox.Show("Search string not found.");
}
else
{
txtPage.SelectionStart = pos;
}
}