コード例 #1
0
        protected override void OnDragStart(MouseEventArgs args)
        {
            base.OnDragStart(args);

            _dragging = true;

            _rectangleDrag = new RectangleDrag();
            _bounds        = Control.Bounds;

            using (DesktopGraphics graphics = new DesktopGraphics())
            {
                _rectangleDrag.Start(GetScreenRectangle(_bounds), graphics);
            }

            _flags = GetDirectionFlags(GetDragDirection(args.Location));
        }
コード例 #2
0
        public void Start(Point startPoint)
        {
            if (_enabled)
            {
                _drag       = new RectangleDrag();
                _startPoint = startPoint;

                if (_dragCursor != null)
                {
                    if (_setCursor != null)
                    {
                        _setCursor.Dispose();
                    }

                    _setCursor = new SetCursor(_dragCursor);
                }

                using (DesktopGraphics graphics = new DesktopGraphics())
                {
                    _drag.Start(_control.Parent.RectangleToScreen(_control.Bounds), graphics);
                }
            }
        }