我正在使用WPF,我有一個ScrollViewer,並希望檢測滾動條的水平移動。WPF:滾動條移動檢測
我發現這個,但不知道如何在我的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>
你剛纔問此相同的問題在這裏: http://stackoverflow.com/questions/16963003/wpf-get-an-event-on-the-scrollbar-from-scrollviewer –