I have been poking around to understand how can I scroll the MDI Form with the Mouse Wheel event.
so I was able to capture and wire the event call. However, when the Child Form appears the MDI Form (Parent) gets its vertical scroll bar automatically.
And when I capture the mouse wheel as below, pretty much all the values of the scrollbar are 0s, even when I try to change them.
so I am not sure if I am missing the point or doing something completely wrong!
private void Form_MouseWheel(object sender, MouseEventArgs e)
{
Debug.WriteLine("Vertical Value:" + this.VerticalScroll.Value);
Debug.WriteLine(" MouseEventArgs Y:" + e.Y);
Debug.WriteLine("AutoScrollPosition:" + this.AutoScrollPosition);
this.VerticalScroll.Value += 1;
this.AutoScrollPosition = new
Point(AutoScrollPosition.X, AutoScrollPosition.Y + 1);
}
OutPut:
Vertical Value:0
MouseEventArgs Y:405
AutoScrollPosition:{X=0,Y=0}