Esempio n. 1
0
        private void OnMouseMove(object sender, MouseEventArgs e)
        {
            if (e.Button != MouseButtons.Left || m_DraggedTab == null || MerthsoftExtensions.IsRunningOnMono())
            {
                return;
            }

            TabPage tab = TabAt(e.Location);

            if (tab == null || tab == m_DraggedTab)
            {
                return;
            }

            Swap(m_DraggedTab, tab);
            SelectedTab = m_DraggedTab;
        }
Esempio n. 2
0
        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;
            }
        }