private void OnMouseDown(object sender, MouseEventArgs e) { TabPage clickedTab = TabAt(e.Location); switch (e.Button) { case MouseButtons.Left: if (MerthsoftExtensions.IsRunningOnMono()) { return; } m_DraggedTab = clickedTab; break; case MouseButtons.Middle: TabCloseEventHandler temp = TabClose; if (temp != null) { TabCloseEventArgs args = new TabCloseEventArgs(clickedTab); temp(this, args); if (!args.Cancel) { TabPages.Remove(clickedTab); } } break; case MouseButtons.None: break; case MouseButtons.Right: break; case MouseButtons.XButton1: break; case MouseButtons.XButton2: break; default: break; } }
public static void RemoveClosingHandler(UIElement element, TabCloseEventHandler handler) => element.RemoveHandler(ClosingEvent, handler);
public static void AddClosingHandler(UIElement element, TabCloseEventHandler handler) => element.AddHandler(ClosingEvent, handler);