private void findAndReplace() { findToolStripMenuItem.Enabled = false; toolStripButtonFindTool.Enabled = false; FindTool creator = new FindTool(); creator.Owner = this; creator.KeyChange += TextOnChangeFind; creator.Show(); creator.Closed += FindOnClosed; }
void TextOnChangeFind(object sender, EventArgs args) { FindTool creator = (FindTool)sender; string pattern = creator.GetPattern; if (creator.isReplaceMethod) { ReplaceAll(richTextBoxLibraryContent, pattern, creator.GetReplaceWord); } else { FindPattern(pattern); } }