Mouse Scroll Wheel

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
 
K

kimiraikkonen

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
 
M

Mark

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top