private void btnCancel_Click(object sender, EventArgs e) { if (_currentThread.IsAlive) { if (_isFindOnly) { _finder.CancelFind(); } else { _replacer.CancelReplace(); } } }