473,324 Members | 2,473 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Preventing mouse wheel scrolling in a combo box

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

Aug 23 '06 #1
2 14197
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

"Greg" <gr*************@yahoo.co.ukwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
>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

Aug 23 '06 #2
Fantastic, that worked a treat - thank you Razz!

razzielx wrote:
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

"Greg" <gr*************@yahoo.co.ukwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
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
Aug 24 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: | last post by:
Hi! I develop an application and I need a mouse driver for universal and intelligent scrolling behaviour with wheel. Something like the Microsoft IntelliMouse has. Is something like that...
6
by: serge calderara | last post by:
Dear all, I would like to be able to use the mouse wheel button in my windows application to scroll my control data. The weel gets two function, when you rotate it and whne you press it. How...
0
by: Jack | last post by:
Gday everyone, I'm dearly hoping Stephen Lebans is going to update his masterpeice to stop the mouse wheel scrolling to work on subforms *he has indicated this to me but of course beggers can't...
1
by: jv | last post by:
I have quite a few of continuous form and subform where I do allow scroll bars. I run into problems with the mouse wheel whenever the data on the form does not take up the whole page. In this...
1
by: Otie | last post by:
Can this be fixed? I have a combo box which is filled with lots of choices on a certain form. I click on the combo box and want to scroll down through the items using my mouse's scroll wheel....
6
by: GGerard | last post by:
Hello I have an Access 2000 form with the following properties: Record Source - Table1
5
by: Bryan Masephol | last post by:
Hi All I got a datagrid and a ComboBox on a form. I populate the combobox with years for all the data avaiable. When the user chooses a year the datagrid is populated with the specific years...
0
by: 6tc1 | last post by:
Hi all, I've got a UserControl that contains a few PictureBox objects. If I click on outside of the Picture in the UserControl, the scrolling with the mouse button works - however, no amount of...
12
by: Mr. T | last post by:
All, I am having a problem and would greatly appreciate any and all information you could pass on to tme. I am working on a database and I would like for a person to be able to scroll through a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.