我在继承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,大多数应用程序应检查正值或负值而不是总计.在大多数情况下,我每次点击只看到1次制动 – 它们可能会快速连续,但每次点击1次(e.Delta = 120).
要获得MouseWheel delata因子:
WheelDelta As Integer = SystemInformation.MouseWheelScrollDelta
它是System.Windows.Forms的成员以及各种其他指标,如滚动拇指宽度等.