我正在使用 WPF 并且我有一个 ScrollViewer 并且想要检测滚动条的水平移动。
我找到了这个,但不确定如何在我的 C# 代码中使用它。
我不想检测到我的 ScrollViewer 上的双击或单击,因为我将它用于其他用途。
<ScrollViewer x:Name="coordinateScroll" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" Margin="75,0,0,0" Width="1125" Height="750" Background="Transparent" MouseWheel="coordinateSystemBackground_MouseWheel" MouseDoubleClick="coordinateScroll_MouseDoubleClick " ScrollChanged="coordinateScroll_ScrollChanged" >
<Canvas x:Name="coordinateSystem" HorizontalAlignment="Left" VerticalAlignment="Top" Cursor="Cross" UseLayoutRounding="False" Width="1125" Height="720" Background="Transparent" MouseWheel="coordinateSystemBackground_MouseWheel" >
</Canvas>
</ScrollViewer>