ScrollViewer mouse wheel not scrolling

后端 未结 6 1192
长发绾君心
长发绾君心 2020-12-05 01:37

I am currently working on my first WPF project and trying to make a ListView scrollable. At first I thought this could be easily done by simply limiting the

6条回答
  •  一生所求
    2020-12-05 02:03

    This may help you..

    private void ListViewScrollViewer_PreviewMouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e)
    {
       ScrollViewer scv = (ScrollViewer)sender;
       scv.ScrollToVerticalOffset(scv.VerticalOffset - e.Delta);
       e.Handled = true;
     }
    

提交回复
热议问题