public virtual void CustomScrollWheel(int rotationDelta)
{
if (rotationDelta >= 120 || rotationDelta <= -120)
{
if (VScrollBarVisible)
{
Point current = CustomScrollPosition;
int newY = current.Y +
SystemInformation.MouseWheelScrollLines * VScrollBar.SmallChange * -Math.Sign(rotationDelta);
//check that the value is between max and min
if (newY < 0)
newY = 0;
if (newY > MaximumVScroll)
newY = MaximumVScroll;
CustomScrollPosition = new Point(current.X, newY);
}
}
}