gpt4 book ai didi

vb.net - 寻找 WHEEL_DELTA 常量

转载 作者:行者123 更新时间:2023-12-04 12:08:32 26 4
gpt4 key购买 nike

我正在处理继承 NumericUpDown 的 UserControl 中的鼠标滚轮事件

Private Sub MyUpDown_MouseWheel(sender As Object, e As MouseEventArgs) Handles Me.MouseWheel
Me.Value += e.Delta * Me.Increment ' / WHEEL_DELTA
End Sub
MouseEventArgs.Delta有这个工具提示:

Gets a signed count of the number of detents the mouse wheel has rotated, multiplied by the WHEEL_DELTA constant. A detent is one notch of the mouse wheel.



但是我找不到这个常数。通常是 120,但我通常不想存钱。我怎样才能将它公开给我的代码?

最佳答案

根据 MSDN Most applications should check for a positive or negative value rather than an aggregate total.在大多数情况下,我只看到每次点击 1 次制动运动 - 它们可能会快速连续出现,但每次点击 1 滴答声(e.Delta=120)。

要获得 MouseWheel 增量因子:

 WheelDelta As Integer = SystemInformation.MouseWheelScrollDelta

它是 System.Windows.Forms 的成员以及各种其他指标,如滚动拇指宽度等。

关于vb.net - 寻找 WHEEL_DELTA 常量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21613558/

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