Preventing mouse wheel scrolling in a combo box

G

Greg

I need to prevent a combo box's contents from being scrolled using the
mouse wheel.

I've tried using an overridden combo box and ignoring the base call
within
protected override void OnMouseWheel(MouseEventArgs e)
However, for some bizarre reason, the scrolling still works. How can
this be? The info isn't being sent to the base class, so how can it
know to scroll?

Slightly confused here - I'd be grateful for any comments!

Greg
 
R

razzielx

If you use .net 2.0 you might use the following event handler

private void YourComboBox_MouseWheel(object sender, MouseEventArgs e)
{
((HandledMouseEventArgs)e).Handled = true;

//do your own processing here
}

razz
 
G

Greg

Fantastic, that worked a treat - thank you Razz!
If you use .net 2.0 you might use the following event handler

private void YourComboBox_MouseWheel(object sender, MouseEventArgs e)
{
((HandledMouseEventArgs)e).Handled = true;

//do your own processing here
}

razz
 

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