private void ResetFind(object sender, EventArgs e)
{
txtEdit.ResetFind();
if (sender is RichTextBox)
{
RichTextBox rtb = (RichTextBox)sender;
// disable TextChanged temporarily under Mono otherwise get infinite loop
if(Globals.UsingMono)
txtFind.TextChanged -= ResetFind;
rtb.ResetFormatting();
if(Globals.UsingMono)
txtFind.TextChanged += ResetFind;
}
btnFind.Enabled = txtFind.TextLength > 0;
if (!btnFind.Enabled)
btnFind.BackColor = SystemColors.ButtonFace;
}