void FindNext() { if (_findBuffer.Length == 0) { Find(); return; } // show cancel dialog _formFindCancel = new FormFindCancel(); _formFindCancel.SetHexBox(hexBox1); _formFindCancel.Closed += new EventHandler(FormFindCancel_Closed); _formFindCancel.Show(); // block activation of main form //Activated += new EventHandler(FocusToFormFindCancel); // start find process long res = hexBox1.Find(_findBuffer, hexBox1.SelectionStart + hexBox1.SelectionLength); _formFindCancel.Dispose(); // unblock activation of main form //Activated -= new EventHandler(FocusToFormFindCancel); if (res == -1) // -1 = no match { MessageBox.Show("Find reached end of file", "T5Suite 2.0", MessageBoxButtons.OK, MessageBoxIcon.Information); } else if (res == -2) // -2 = find was aborted { return; } else // something was found { if (!hexBox1.Focused) { hexBox1.Focus(); } } ManageAbility(); }
void FindNext() { if (_findBuffer.Length == 0) { Find(); return; } // show cancel dialog _formFindCancel = new FormFindCancel(); _formFindCancel.SetHexBox(hexBox1); _formFindCancel.Closed += new EventHandler(FormFindCancel_Closed); _formFindCancel.Show(); // block activation of main form //Activated += new EventHandler(FocusToFormFindCancel); // start find process long res = hexBox1.Find(_findBuffer, hexBox1.SelectionStart + hexBox1.SelectionLength); _formFindCancel.Dispose(); // unblock activation of main form //Activated -= new EventHandler(FocusToFormFindCancel); if (res == -1) // -1 = no match { MessageBox.Show("Find reached end of file", "T5Suite 2.0", MessageBoxButtons.OK, MessageBoxIcon.Information); } else if (res == -2) // -2 = find was aborted { return; } else // something was found { if (!hexBox1.Focused) hexBox1.Focus(); } ManageAbility(); }