/// <summary> /// Raises the Click event /// </summary> /// <param name="e">Event data</param> public virtual void OnClick(EventArgs e) { try { if (!Enabled) { return; } if (ClosesDropDownAt(Canvas.PointToClient(Cursor.Position))) { DeactivateToolTip(_TT); RibbonPopupManager.Dismiss(RibbonPopupManager.DismissReason.ItemClicked); } SetSelected(false); if (Click != null) { Click(this, e); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
/// <summary> /// Raises the MouseDown event /// </summary> /// <param name="e">Event data</param> public virtual void OnMouseDown(MouseEventArgs e) { if (!Enabled) { return; } if (MouseDown != null) { MouseDown(this, e); } RibbonPopup pop = Canvas as RibbonPopup; if (pop != null) { if (ClosesDropDownAt(e.Location)) { RibbonPopupManager.Dismiss(RibbonPopupManager.DismissReason.ItemClicked); } OnClick(EventArgs.Empty); } SetPressed(true); }
private void _keyboardHook_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Escape) { RibbonPopupManager.Dismiss(RibbonPopupManager.DismissReason.EscapePressed); } }
protected override void OnKeyDown(KeyEventArgs e) { if (e.KeyCode == Keys.Escape) { RibbonPopupManager.Dismiss(RibbonPopupManager.DismissReason.EscapePressed); } base.OnKeyDown(e); }
/// <summary> /// Closes the DropDown if opened /// </summary> public void CloseDropDown() { if (DropDown != null) { RibbonPopupManager.Dismiss(DropDown, RibbonPopupManager.DismissReason.NewPopup); } SetDropDownVisible(false); }
/// <summary> /// Removes all helper controls placed by any reason. /// Contol's visibility is set to false before removed. /// </summary> private void RemoveHelperControls() { RibbonPopupManager.Dismiss(RibbonPopupManager.DismissReason.AppClicked); while (Controls.Count > 0) { Control ctl = Controls[0]; ctl.Visible = false; Controls.Remove(ctl); } }
/// <summary> /// Raises the Click event /// </summary> /// <param name="e">Event data</param> public virtual void OnClick(EventArgs e) { if (!Enabled) { return; } if (ClosesDropDownAt(Canvas.PointToClient(Cursor.Position))) { RibbonPopupManager.Dismiss(RibbonPopupManager.DismissReason.ItemClicked); } SetSelected(false); if (Click != null) { Click(this, e); } }
/// <summary> /// Raises the Click event /// </summary> /// <param name="e">Event data</param> public virtual void OnClick(EventArgs e) { if (!Enabled) { return; } if (Click != null) { Click(this, e); } RibbonPopup pop = Canvas as RibbonPopup; if (pop != null) { if (ClosesDropDownAt(Cursor.Position)) { RibbonPopupManager.Dismiss(RibbonPopupManager.DismissReason.ItemClicked); } } }