private void OnClick(object sender, MouseEventArgs e) { // We do not operate the qat button at design time if (!_ribbon.InDesignMode) { Form ownerForm = _ribbon.FindForm(); // Ensure the form we are inside is active ownerForm?.Activate(); // Inform quick access toolbar button it has been clicked _qatButton.PerformClick(); } }
private void OnClick(object sender, MouseEventArgs e) { // We do not operate the qat button at design time if (!_ribbon.InDesignMode) { Form ownerForm = _ribbon.FindForm(); // Ensure the form we are inside is active if (ownerForm != null) { ownerForm.Activate(); } // Inform quick access toolbar button it has been clicked if (_qatButton.IsDropDownButton) { _qatButton.PerformDropDown(/*this.FinishDelegate*/); } else { _qatButton.PerformClick(); } } }