1

我得到了带有 a 的表单vertical scroll bar,我想使用鼠标滚轮来上下滚动表单,但我似乎无法mousewheel event启动。

我只是使用标准mousewheel事件

Private Sub frmTest_MouseWheel(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseWheel

'code here

End Sub

任何帮助,将不胜感激。

4

1 回答 1

3

Panel尝试在您的Form集合中放置一个AutoScroll = trueDock = Fill然后从该Panel位置放置所有您可以控制的位置,例如,TextBox等。labellistView

  Private Sub Panel1_MouseEnter(sender As System.Object, e As System.EventArgs) Handles Panel1.MouseEnter
        Panel1.Focus()
  End Sub

  Private Sub Panel1_MouseWheel(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseWheel
        MessageBox.Show("okay")
  End Sub
于 2013-02-20T08:03:06.607 回答