System.Windows.Forms.Form has only one scroll event-Scroll, but it is necessary to recognize scrolling up and scrolling down.Could you tell me,how to do this?
Asked
Active
Viewed 9,557 times
3 Answers
8
Use the passed System.Windows.Forms.ScrollEventArgs arguments' OldValue and NewValue properties to detect the scroll direction.

M.A. Hanin
- 8,044
- 33
- 51
5
private void dgv_Scroll(object sender, ScrollEventArgs e)
{
if (e.OldValue > e.NewValue)
{
// here up
}
else
{
// here down
}
}

josliber
- 43,891
- 12
- 98
- 133

Mena Dawoud
- 51
- 1
- 2