private void panelTitle_Click(object sender, EventArgs e) { if (_button == null) { return; } MouseEventArgs mea = e as MouseEventArgs; if (mea.Button == System.Windows.Forms.MouseButtons.Left) { if (!_overCloseButton) { OnActivate(sender, TooltipEventArgs.From(_button)); ForceHide(); } else { OnClose(sender, TooltipEventArgs.From(_button)); ForceHide(); } } else if (mea.Button == System.Windows.Forms.MouseButtons.Middle) { OnClose(sender, TooltipEventArgs.From(_button)); ForceHide(); } else if (mea.Button == System.Windows.Forms.MouseButtons.Right) { SystemMenuProxy.BeginOpenSystemMenu(_button.Tag as SecondDisplayProcess, this.Handle); } }
private void panelTitle_MouseLeave(object sender, EventArgs e) { PanelHover = false; if (_button == null) { return; } ShowLivePreview(_button, false); OnCustomLeave(sender, TooltipEventArgs.From(_button)); }
private void panelTitle_MouseEnter(object sender, EventArgs e) { PanelHover = true; CancelHide(); if (_button == null) { return; } if (_delayedActionPreview.Active) { _delayedActionPreview.Cancel(); } _delayedActionPreview.Init(delegate() { ShowLivePreview(_button, true); }, WindowsConstants.TaskbarLivePreviewDelay); OnCustomEnter(sender, TooltipEventArgs.From(_button)); }
public void ForceHide() { if (SystemMenuProxy.IsOpening) { return; } _closeForm.Hide(); base.Hide(); if (_button != null) { OnCustomLeave(null, TooltipEventArgs.From(_button)); ShowLivePreview(_button, false); } _button = null; _doHide = false; }