如何在组合框控件中禁用鼠标滚轮?
<ComboBox x:Name="ListDates" SelectedValuePath="Tag" Width="185" Background="#FFFFCC00" BorderThickness="1" Margin="12,8,0,0"/>
最佳答案
此解决方案冗长但有效。创建您的组合框类并使用空处理程序覆盖 OnPointerWheelChanged
。
public class ComboBoxNoWheel: ComboBox
{
protected override void OnPointerWheelChanged(PointerRoutedEventArgs e)
{
}
}
您可以添加 e.handled = true
但这与我的测试没有区别。组合框打开时滚动效果很好。
关于c# - Windows 10 UWP 应用程序 c# - 在组合框中禁用鼠标滚轮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32957899/