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