Disable scrollwheel in ComboBox?

C

Chris DiPierro

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?
 
G

Guest

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.
 
C

Chris DiPierro

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.
 

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