Esempio n. 1
0
        /// <summary>
        /// Raises the MouseMove event.
        /// </summary>
        /// <param name="e">A MouseEventArgs that contains the event data.</param>
        protected override void OnMouseMove(MouseEventArgs e)
        {
            if ((_resizeSource != null) && (_resizeSource.CanResize(this)))
            {
                // Display the correct mouse shape
                if (_direction == LayoutDirection.Vertical)
                {
                    this.Cursor = Cursors.SizeNS;
                }
                else
                {
                    this.Cursor = Cursors.SizeWE;
                }
            }
            else
            {
                this.Cursor = Cursors.Arrow;
            }

            // Currently in a resizing operation?
            if (_resizing)
            {
                UpdateResizePosition(e);
            }

            base.OnMouseMove(e);
        }
Esempio n. 2
0
        protected bool StartResizeOperation(MouseEventArgs e)
        {
            if (_resizeSource != null)
            {
                if (_resizeSource.CanResize(this))
                {
                    if (_resizeSource.StartResizeOperation(this, ref _boundary))
                    {
                        // Record the starting screen position
                        _pointStart = PointToScreen(new Point(e.X, e.Y));

                        // Record the current position being drawn
                        _pointCurrent = _pointStart;

                        // Draw the starting position
                        DrawResizeIndicator(_pointCurrent);

                        return(true);
                    }
                }
            }

            return(false);
        }