private void OnClickSearchReplace(object sender, EventArgs e) { if (_searchPanel != null && !_searchPanel.IsDisposed) { _searchPanel.Hide(); } if (_replacePanel == null || _replacePanel.IsDisposed) { _replacePanel = new ReplaceForm(); _replacePanel.Owner = this; } var posRect = textEditor.RectangleToScreen(textEditor.ClientRectangle); var winSize = _replacePanel.Size; _replacePanel.Left = posRect.Right - winSize.Width - SearchGlobals.Offset * 4; _replacePanel.Top = posRect.Top + SearchGlobals.Offset; Action <string, bool, bool> searchListener = this.SearchTextChanged; _replacePanel.SearchText = tbbTextBoxFind.Text; _replacePanel.IsMatchCase = _isMatchCase; _replacePanel.IsMatchWholeWord = _isMatchWholeWord; _replacePanel.Show(_mainForm, textEditor, searchListener, true); }
public override void OnPageDeselected(EventArgs e) { base.OnPageDeselected(e); if (_searchPanel != null && _searchPanel.IsDisposed == false) { _searchPanel.Close(); _searchPanel = null; } if (_replacePanel != null && _replacePanel.IsDisposed == false) { _replacePanel.Close(); _replacePanel = null; } }