gpt4 book ai didi

c# - Windows 10 UWP 应用程序 c# - 在组合框中禁用鼠标滚轮

转载 作者:行者123 更新时间:2023-12-04 01:59:27 24 4
gpt4 key购买 nike

如何在组合框控件中禁用鼠标滚轮?

<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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com