private void FindingForm_FormClosing(object sender, FormClosingEventArgs e) { foreach (TabPage tabPage in TabControlMethods.TabControl.TabPages) { TypingArea textArea = (tabPage.Controls[0] as MyRichTextBox).TypingArea; textArea.ClearBackColor(textArea.BackColor); } this.Visible = false; e.Cancel = true; }
private void findButton_Click(object sender, EventArgs e) { TypingArea currentTextArea = TabControlMethods.CurrentTextArea; previousText = currentTextArea.Text; //Remove the highlight backcolor of the privous search currentTextArea.ClearBackColor(currentTextArea.BackColor); textsFound.Clear(); textsFound = currentTextArea.FindAndColorAll(searchTextbox.Text, AllFoundTextBackColor); indexOfSearchText = -1; this.Focus(); }