Mouse Scroll Wheel

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

Does anyone know of a way to disable the mouse scroll wheel when a control
such as a combobox or listbox has focus? I ask this, because I have an
extremely large data entry form with vertical scrollbars. I have found that
when a user scrolls the wheel in an attempt to scroll the form down, a
combobox or listbox will scroll instead (if it has focus) thus changing the
user's original selection.

Thanks for any help you can provide!
Mark
 
Does anyone know of a way to disable the mouse scroll wheel when a control
such as a combobox or listbox has focus? I ask this, because I have an
extremely large data entry form with vertical scrollbars. I have found that
when a user scrolls the wheel in an attempt to scroll the form down, a
combobox or listbox will scroll instead (if it has focus) thus changing the
user's original selection.

Thanks for any help you can provide!
Mark

Hi Mark,
Here is a code sample for a listbox which is used to disable mouse
wheel scrolling:

Private Sub ListBox1_MouseWheel(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) _
Handles ListBox1.MouseWheel
Dim disable As HandledMouseEventArgs = e
disable.Handled = True
End Sub

I tested and i hope it works for you,

Onur Güzel
 
Beautiful!

Thanks so much!!

Mar

kimiraikkonen said:
Hi Mark,
Here is a code sample for a listbox which is used to disable mouse
wheel scrolling:

Private Sub ListBox1_MouseWheel(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) _
Handles ListBox1.MouseWheel
Dim disable As HandledMouseEventArgs = e
disable.Handled = True
End Sub

I tested and i hope it works for you,

Onur Güzel
 
Back
Top