C# 3.0 数字上下控制

C# 3.0 数字上下控制,c#-3.0,C# 3.0,我使用数字上下控制。在侦听这些事件时更改了最小值和最大值 this.numDownMinLimit.ValueChanged+=new System.EventHandlerthis.numDownMinLimit\u ValueChanged; this.numDownMaxLimit.ValueChanged+=new System.EventHandlerthis.numDownMaxLimit\u ValueChanged 步长设置为0.1 eventhandler需要一些时间才能完成

我使用数字上下控制。在侦听这些事件时更改了最小值和最大值 this.numDownMinLimit.ValueChanged+=new System.EventHandlerthis.numDownMinLimit\u ValueChanged; this.numDownMaxLimit.ValueChanged+=new System.EventHandlerthis.numDownMaxLimit\u ValueChanged

步长设置为0.1

eventhandler需要一些时间才能完成

如果按住鼠标一段时间,然后将其释放,eventhandler仍将使用先前激发的值执行


我们如何防止这种情况发生?当用户释放鼠标按钮时,我想丢弃仍在队列中等待处理的剩余事件。

您需要查看处理此行为的NumericUpDownAcceleration类:

发件人:

NumericUpDownAcceleration对象 由NumericUpDown控件使用 有选择地提供加速 当递增或递减 通过大量的 数字


让我们了解您的进展情况。

在停止更新值后未解决问题。我也会得到之前的值。