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;
}
}
frmMain::Find ( string pSearchString, RichTextBoxFinds pFindOptions ) : void |
private void Find() { RichTextBoxFinds options = new RichTextBoxFinds(); if (chkWholeWords.Checked) { options = options | RichTextBoxFinds.WholeWord; } if (chkCase.Checked) { options = options | RichTextBoxFinds.MatchCase; } if (rdoUp.Checked) { options = options | RichTextBoxFinds.Reverse; } parent.Find(txtFind.Text, options); }