Forex_Strategy_Builder.Chart.Scroll_MouseWheel C# (CSharp) Méthode

Scroll_MouseWheel() private méthode

Scrolls the scrollbar when turning the mouse wheel.
private Scroll_MouseWheel ( object sender, MouseEventArgs e ) : void
sender object
e MouseEventArgs
Résultat void
        void Scroll_MouseWheel(object sender, MouseEventArgs e)
        {
            if (isKeyCtrlPressed)
            {
                if (e.Delta > 0)
                    ZoomIn();
                if (e.Delta < 0)
                    ZoomOut();
            }
            else
            {
                int newScrollValue = scroll.Value + scroll.LargeChange * e.Delta / SystemInformation.MouseWheelScrollLines / 120;

                if (newScrollValue < scroll.Minimum)
                    newScrollValue = scroll.Minimum;
                else if (newScrollValue > scroll.Maximum + 1 - scroll.LargeChange)
                    newScrollValue = scroll.Maximum + 1 - scroll.LargeChange;

                scroll.Value = newScrollValue;
            }

            return;
        }