How to detect : scrolling - up or down?

后端 未结 3 1889
独厮守ぢ
独厮守ぢ 2020-12-20 23:57

System.Windows.Forms.Form has only one scroll event-Scroll, but it is necessary to recognize scrolling up and scrollin

相关标签:
3条回答
  • 2020-12-21 00:32
    private void dgv_Scroll(object sender, ScrollEventArgs e)
            {
                if (e.OldValue > e.NewValue)
                {
                    // here up
                }
                else
                {
                    // here down
                }
            }
    
    0 讨论(0)
  • 2020-12-21 00:36

    Use the passed System.Windows.Forms.ScrollEventArgs arguments' OldValue and NewValue properties to detect the scroll direction.

    0 讨论(0)
  • 2020-12-21 00:39

    Checkout ScrollEventArgs Class and this answer.

    0 讨论(0)
提交回复
热议问题