是否可以禁用ComboBox
下拉菜單中的自動滾動效果?問題是當鼠標懸停在開放的最後一個元素ComboBox
上時,它會自動滾動到下一個元素。在組合框中禁用滾動鼠標移動(WPF)
而在我的情況下,ComboBox
是在屏幕的底部,並向上顯示的列表中,當我打開ComboBox
和移動鼠標,它向下滾動立即..我的XAML看起來像這樣:
<ComboBox x:Name="serverSelection" ScrollViewer.CanContentScroll="False" Width="268" Height="54" FontSize="18" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" SelectedIndex="0">
<ComboBoxItem Content="xenappts01" HorizontalAlignment="Left" Width="280" Height="54" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
<ComboBoxItem Content="xenappts02" HorizontalAlignment="Left" Width="280" Height="54" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
<ComboBoxItem Content="xenappts03" HorizontalAlignment="Left" Width="280" Height="54" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
<ComboBoxItem Content="xenappts04" HorizontalAlignment="Left" Width="280" Height="54" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
<ComboBoxItem Content="xenappts05" HorizontalAlignment="Left" Width="280" Height="54" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
<ComboBoxItem Content="xenappts05c" HorizontalAlignment="Left" Width="280" Height="54" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
</ComboBox>
我試圖設置ScrollViewer.CanContentScroll="False"
但沒有奏效。
這是什麼樣子:
https://i.stack.imgur.com/GcwJX.gif
感謝您的幫助!
請添加一個例子,你的問題 – Ben