By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,062 Members | 1,358 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,062 IT Pros & Developers. It's quick & easy.

Mouse Scroll Wheel

P: n/a
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
Aug 21 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Aug 21, 7:57 pm, Mark <M...@discussions.microsoft.comwrote:
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
Aug 21 '08 #2

P: n/a
Beautiful!

Thanks so much!!

Mar

"kimiraikkonen" wrote:
On Aug 21, 7:57 pm, Mark <M...@discussions.microsoft.comwrote:
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
Aug 21 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.