473,406 Members | 2,843 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,406 software developers and data experts.

Lock mouse scroll in a combo box...

Aimee Bailey
197 Expert 100+
Hi, i've been trying to stop the user from scrolling their mouse inside a WPF combobox, does anyone know how this can be achieved?

.Net 4.0
Oct 13 '10 #1
4 6410
GaryTexmo
1,501 Expert 1GB
Hi Aimee,

I don't know very much WPF, but I was able to do this in WinForms so hopefully it helps. I got this working by creating a new class and inheriting from a ComboBox. Then I created an override on the WndProc method and checked for the mouse wheel message. If I got that one, I did nothing, otherwise I just called the base WndProc.

This prevented the mouse wheel from scrolling my combo box, but everything else was fine.

The code for WM_MOUSEWHEEL is 0x020A. Hopefully you're able to convert that to a WPF equivalent.
Oct 13 '10 #2
Curtis Rutland
3,256 Expert 2GB
Perhaps this thread will help:
http://stackoverflow.com/questions/2...control-in-wpf
Oct 13 '10 #3
GaryTexmo
1,501 Expert 1GB
So, it looks like this is easier said than done with WPF. I did some googling around and you can indeed override WndProc on WPF, kinda... but it's a pain.

I don't really understand this (ie, I can't get it to work) but I'm not well versed in WPF. Perhaps this will help?

http://efreedom.com/Question/1-21890...emscontrol-Wpf
Oct 13 '10 #4
Aimee Bailey
197 Expert 100+
Thanks for your replies, in the end i stopped the entire grid from scroll mousing, it takes away a little functionallity, but then again on the bright side a hundred queries to the database are not being sent anymore either :)

Aimee.
Oct 14 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: MARK | last post by:
I have 2 forms both with a combo box. The selection within the combo box is based on a statement each: SELECT * FROM dbo_consumables ORDER BY ; & SELECT DISTINCT FROM dbo_consumables...
2
by: Niranjan | last post by:
I downloaded Access Mouse Scroll Hook from www.lebans.com. I have Windows 2000 and Access 2000. It did not work on my machine. I copied the dll to c:\Winnt\system folder and then opened the...
6
by: Debbie | last post by:
Hi Stephen, I'm trying to use your mousehook off...and thanks so much... it's such a blessing that you share with the rest of us. I have the dll in the same folder as the database and placed...
1
by: nicholas | last post by:
Hi, If on an asp.net page the user has just selected a value in a dropdownlist and scrolls with the wheel of his mouse, the selected value of the dropdownlist will change. How could I avoid...
6
by: dk4300 | last post by:
Hi!! I have a subform with a comments (memo) field, linked to a form. On the Memo field: Properties-Other-Enter Key Behavior = New Line in Field On the subform: Properties- Other- Cycle =...
2
by: ilikebirds | last post by:
Access 2003: I notice that on a form there is a menu for RECORDS - Data Entry. What occurs here is when data is updated and the option is selected It enters the data into the table and starts...
7
pentahari
by: pentahari | last post by:
I am add the mouse scroll bar Add-Ins for enable mouse scroll in Visualbasic 6.0 IDE. its work fine. but i want work the mouse scroll in form at runtime. Thanks Advance.
2
by: =?Utf-8?B?TWFyaw==?= | last post by:
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...
5
by: Wayneyh | last post by:
Hi All I want to stop the scroll wheel on the mouse. I have looked through the forum and downloaded the file from MouseWheelOnOff. I have entered the code Private Sub Form_Load() 'Turn...
2
by: tezu | last post by:
hi , Im writing an application which has a scroll bar ,i need to disable it, is there any built in function for doing it???? if not then how can i do it ?? please help :)
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.