471,349 Members | 1,608 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,349 software developers and data experts.

Disable scrollwheel in ComboBox?

Is there a way to disable scroll wheel support in a combobox?

Basically, I have a situation where a user chooses an option in a
combobox. I'm handling the selected index change event, and due to the
option they chose, the combobox itself is being destroyed (dynamic UI).

However, if they've managed to choose an option and then roll the scroll
wheel, I'll get an unhandled exception when Windows tries to fire the
events associated with the scrollwheel choices.

Even if I can't disable the scrollwheel, is it possible to clear the
event queue of any events related to the control?
Jul 21 '05 #1
2 2453
Instead of finding a way to trap a scroll wheel, you can use a flag and then
turn it to true whenever the control itself is destroyed. And put all the
code in the selectedIndex event handler inside the false of the flag.

Not a graceful solution I agree. But still a patch like this would work till
you get a elegant solution.

"Chris DiPierro" wrote:
Is there a way to disable scroll wheel support in a combobox?

Basically, I have a situation where a user chooses an option in a
combobox. I'm handling the selected index change event, and due to the
option they chose, the combobox itself is being destroyed (dynamic UI).

However, if they've managed to choose an option and then roll the scroll
wheel, I'll get an unhandled exception when Windows tries to fire the
events associated with the scrollwheel choices.

Even if I can't disable the scrollwheel, is it possible to clear the
event queue of any events related to the control?

Jul 21 '05 #2
Ideally true, but it's not my handling of the event that's a problem.
Instead I get an exception when Windows tries to dole out the event to
my now disposed control.
Raghavendran Muraleetharan wrote:
Instead of finding a way to trap a scroll wheel, you can use a flag and then
turn it to true whenever the control itself is destroyed. And put all the
code in the selectedIndex event handler inside the false of the flag.

Not a graceful solution I agree. But still a patch like this would work till
you get a elegant solution.

"Chris DiPierro" wrote:

Is there a way to disable scroll wheel support in a combobox?

Basically, I have a situation where a user chooses an option in a
combobox. I'm handling the selected index change event, and due to the
option they chose, the combobox itself is being destroyed (dynamic UI).

However, if they've managed to choose an option and then roll the scroll
wheel, I'll get an unhandled exception when Windows tries to fire the
events associated with the scrollwheel choices.

Even if I can't disable the scrollwheel, is it possible to clear the
event queue of any events related to the control?

Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Chris DiPierro | last post: by
2 posts views Thread by RichG | last post: by
2 posts views Thread by CenturionX | last post: by
5 posts views Thread by Kevinp | last post: by
2 posts views Thread by Claudia Fong | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.