How to determine: scroll up or down?

System.Windows.Forms.Form has only one scroll event. Scrolling , but you need to recognize scrolling and scrolling down. Could you tell me how to do this?

+4
source share
3 answers

Use the passed Properties properties of OldValue and NewValue for System.Windows.Forms.ScrollEventArgs to determine the scroll direction.

+5
source
private void dgv_Scroll(object sender, ScrollEventArgs e) { if (e.OldValue > e.NewValue) { // here up } else { // here down } } 
+2
source

Checkout ScrollEventArgs Class and this answer .

0
source

Source: https://habr.com/ru/post/1308540/


All Articles