AnimatGuiCtrls.Controls.ComboTreeBox.OnMouseWheel C# (CSharp) Method

OnMouseWheel() protected method

Scrolls between adjacent nodes, or scrolls the drop-down portion of the control in response to the mouse wheel.
protected OnMouseWheel ( MouseEventArgs e ) : void
e MouseEventArgs
return void
        protected override void OnMouseWheel(MouseEventArgs e)
        {
            base.OnMouseWheel(e);
            if (DroppedDown)
                dropDown.ScrollDropDown(-(e.Delta / 120) * SystemInformation.MouseWheelScrollLines);
            else if (e.Delta > 0) {
                ComboTreeNode prev = GetPrevDisplayedNode();
                if (prev != null) SetSelectedNode(prev);
            }
            else if (e.Delta < 0) {
                ComboTreeNode next = GetNextDisplayedNode();
                if (next != null) SetSelectedNode(next);
            }
        }