protected override void OnMouseWheel(MouseEventArgs e)
{
base.OnMouseWheel(e);
if (!this.Scrollable || (!this.HScroll && !this.VScroll))
{
return;
}
if (this.VScroll)
{
int newVal = this.vScrollBar.Value - ((e.Delta / 120) * SystemInformation.MouseWheelScrollLines);
this.vScrollBar.Value = this.EnsureSafeVScrollValue(newVal);
}
else if (this.HScroll)
{
int newVal = this.hScrollBar.Value - ((e.Delta / 120) * Column.MinimumWidth);
if (newVal < 0)
{
newVal = 0;
}
else if (newVal > this.hScrollBar.Maximum - this.hScrollBar.LargeChange)
{
newVal = this.hScrollBar.Maximum - this.hScrollBar.LargeChange;
}
this.HorizontalScroll(newVal);
this.hScrollBar.Value = newVal;
}
}