コード例 #1
0
        protected override void OnMouseMove(MouseEventArgs e)
        {
            base.OnMouseMove(e);
            if (!this.Capture)
            {
                return;
            }
            Point location      = this.ControlBoundingRectangle.Location;
            bool  flag          = false;
            Point mousePosition = Control.MousePosition;

            if (this.lastPoint.HasValue)
            {
                flag = this.lastPoint.Value.Y > mousePosition.Y;
            }
            this.lastPoint = new Point?(mousePosition);
            Point             client = this.ElementTree.Control.PointToClient(mousePosition);
            OverflowEventArgs args   = (OverflowEventArgs)null;

            if (client.Y - location.Y > 20 && !flag)
            {
                args    = new OverflowEventArgs();
                args.Up = false;
            }
            else if (location.Y - client.Y > 20 && flag)
            {
                args    = new OverflowEventArgs();
                args.Up = true;
            }
            if (args == null || this.Dragged == null)
            {
                return;
            }
            this.Dragged((object)this, args);
        }
コード例 #2
0
        protected override void OnMouseMove(System.Windows.Forms.MouseEventArgs e)
        {
            base.OnMouseMove(e);

            if (this.Capture)
            {
                Point currentLocation = this.ControlBoundingRectangle.Location;
                bool  up             = false;
                Point cursorPosition = Control.MousePosition;
                if (this.lastPoint != null)
                {
                    up = this.lastPoint.Value.Y > cursorPosition.Y;
                }

                this.lastPoint = cursorPosition;

                Point             mousePointerOnControl = this.ElementTree.Control.PointToClient(cursorPosition);
                OverflowEventArgs args = null;
                if (mousePointerOnControl.Y - currentLocation.Y > 20 && !up)
                {
                    args    = new OverflowEventArgs();
                    args.Up = false;
                }
                else if (currentLocation.Y - mousePointerOnControl.Y > 20 && up)
                {
                    args    = new OverflowEventArgs();
                    args.Up = true;
                }
                if (args != null && this.Dragged != null)
                {
                    this.Dragged(this, args);
                }
            }
        }
コード例 #3
0
 private void OverflowGripElement_Dragged(object sender, OverflowEventArgs args)
 {
     if (args.Up)
     {
         this.DragGripUp();
     }
     else
     {
         this.DragGripDown();
     }
 }