private void menuFindReplace_Click(object sender, EventArgs e) { // if the Find & Replace dialog isn't open, let's create and show it if (_findReplace != null && _findReplace.Created) { _findReplace.Focus(); return; } var currentTxtEditor = GetCurrentNocTextEditor(); if (currentTxtEditor != null) { _findReplace = new FindReplaceDialog(currentTxtEditor); _findReplace.Show(); } }