コード例 #1
0
        /// <summary>TODO</summary>
        /// <param name="e"></param>
        protected virtual void OnMouseHWheel(MouseEventArgs e)
        {
            if (e == null)
            {
                throw new ArgumentNullException("e");
            }
            if (!AutoScroll)
            {
                return;
            }

            _wheelHPos += e.Delta;
            while (_wheelHPos > MouseWheelStep)
            {
                ScrollHorizontal(MouseWheelStep);
                _wheelHPos -= MouseWheelStep;
            }
            while (_wheelHPos < -MouseWheelStep)
            {
                ScrollHorizontal(-MouseWheelStep);
                _wheelHPos += MouseWheelStep;
            }

            if (MouseHWheel != null)
            {
                MouseHWheel.Raise(this, e);
            }
        }
コード例 #2
0
        private int _wheelHPos = 0; //!< <summary>Unapplied horizontal scroll.</summary>

        /// <summary>Scrolls horizontally and raises the MouseHWheel event</summary>
        /// <param name="e"></param>
        protected virtual void OnMouseHWheel(MouseWheelEventArgs e)
        {
            if (e == null)
            {
                throw new ArgumentNullException("e");
            }
            if (this.CanContentScroll)
            {
                ScrollToHorizontalOffset(HorizontalOffset + e.Delta);

                if (MouseHWheel != null)
                {
                    MouseHWheel.Raise(this, e);
                }
            }
        }