gpt4 book ai didi

c# - MouseWheel 事件不以 120 为增量滚动

转载 作者:太空狗 更新时间:2023-10-30 01:07:56 26 4
gpt4 key购买 nike

我已将 MouseWheel 事件连接到我的一个控件,但我发现 e.Delta 并不总是 120 的倍数,尤其是当我多次滚动它时。我得到像“131”和“-394”这样的数字。

这是为什么呢?我该如何解决?这导致我的程序出现问题,其中数字(除以 120)与勾选的实际缺口数不相关。

最佳答案

显然,您不能再依赖 delta 为 120。 Here's a post about the same issue

还有 MSDN says :

The delta was set to 120 to allow Microsoft or other vendors to build finer-resolution wheels (a freely-rotating wheel with no notches) to send more messages per rotation, but with a smaller value in each message. To use this feature, you can either add the incoming delta values until WHEEL_DELTA is reached (so for a delta-rotation you get the same response), or scroll partial lines in response to the more frequent messages. You can also choose your scroll granularity and accumulate deltas until it is reached.

关于c# - MouseWheel 事件不以 120 为增量滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11075355/

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