vb.net 鼠标滚轮编程
1、 添加窗体

2、 添加窗体的代码
' '判断是否已安装带滚轮的鼠标
' 'SystemInformation.MouseWheelPresent.ToString()
' '获取鼠标滚轮在滚动时所获得的行数
' 'SystemInformation.MouseWheelScrollLines.ToString()
' '判断该操作系统是否支持滚轮鼠标
' 'SystemInformation.NativeMouseWheelSupport.ToString()
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.TextBox1.Text = 0
End Sub
3、 Private Sub PictureBox1_MouseMove1(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMove
'必须添加
Me.PictureBox1.Focus()
End Sub
4、 Private Sub PictureBox1_MouseWheel1(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseWheel
'MessageBox.Show("滚动事件已被捕捉")
If e.Delta > 0 Then
Me.TextBox1.Text += 1
Else
Me.TextBox1.Text -= 1
End If
End Sub
5、 运行程序,鼠标在picturebox框内转动鼠标滚轮,textbox内的数值会发生变化