How to enable horizontal scrolling with mouse?

后端 未结 6 1894
旧巷少年郎
旧巷少年郎 2021-02-01 07:54

I cannot determine how to scroll horizontally using the mouse wheel. Vertical scrolling works well automatically, but I need to scroll my content horizontally. My code looks lik

6条回答
  •  无人共我
    2021-02-01 08:48

    The easiest way is to add PreviewMouseWheel listener to the ScrollViewer, check for shift (or whatever you want to do to indicate horizontal scroll), and then call LineLeft or LineRight (or PageLeft / PageRight) depending on the value of the Delta value of the MouseWheelEventArgs

提交回复
热议问题