473,421 Members | 1,627 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,421 software developers and data experts.

VB: How to prevent MouseWheel msgs from auto-generating scrollbar msgs?

I have a VirtualMode DataGridView that bogs down on using the mouse wheel to scroll and gets a backlog of messages such that it continues to scroll long after ceasing to turn the mouse wheel. This is because instead of generating one scrollbar message for each mouse wheel message it generates a separate scrollbar message for each line move, forcing the entire screen to refresh with each line added.

I've put in code to scroll multiple lines only once for each mouse wheel click, but I'm still having to shunt out all of the extra scrollbar messages and it is not easy. If I get out of sync as to how many scrollbar messages to shunt the scrolling goes out of whack. It would be far easier if I just didn't have to worry about shunting these useless messages.

So how do you prevent mouse wheel messages from creating scrollbar messages?
Jun 10 '08 #1
4 1935
Plater
7,872 Expert 4TB
You can try overrideing the WndProc function on your form. And parse out the mouse wheel messages?
Jun 11 '08 #2
I'm not getting any scrollbar messages in the form's WndProc function (nor any mouse wheel messages) so as I turn the mouse wheel I get no output in the immediate window from the following code:

Protected Overrides Sub WndProc(ByRef m As Message)
Debug.WriteLine(m.Msg)
MyBase.WndProc(m)
End Sub

Moving the mouse around does give me messages.
Jun 11 '08 #3
Plater
7,872 Expert 4TB
Well I don't know what that Debug call does, nothing ever showed up in my window.

I used Console.Writeline and saw them all.

MouseWheel is when m.Msg is 0x20a if that helps.
Jun 11 '08 #4
I was able to get them by deriving a class from DataGridView and overriding it's WndProc.
Jun 11 '08 #5

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

Similar topics

6
by: deko | last post by:
Is it possible to disable the mouse wheel WITHOUT using a DLL? I've looked at Microsoft Knowledge Base Article 278379 (http://support.microsoft.com/default.aspx?scid=kb;en-us;278379), which...
2
by: Jack | last post by:
Hi all, I searched the archives and found everyone happy with Stephen's MouseWheel On/Off code except for those with subforms. Stephen's page indicates that he has added code to handle subforms...
0
by: Mark Johnson | last post by:
Seems the mousewheel isn't controlled in earlier versions like A97 or 2000. So you can accidentally use the mousewheel to scroll to the next record in an unbound form. And that can cause Access to...
1
by: Niranjan | last post by:
I have a data entry form. I am trying to avoid users accidentally using the mouse wheel and saving an incomplete record (or saving record that skips the validation routine). In Mousewheel event,...
5
by: Dennis | last post by:
I have a form with buttons and a custom control I wrote showing a list of items. I would like to scroll the list when the mouse is over the control and the mouse wheel is moved but yet don't want...
1
by: Marcel Sengers | last post by:
Hi folks. I have a problem with a Datatgrid. When my User selects a row in the Datagrid he is able to scroll through the Grid by using the Mousewheel. The prob is that when the selectedrow is...
4
by: tlemcenvisit | last post by:
Hi, I program a windows form application with VC++.NET, I wish to program an event which occurs when the user uses the mouse wheel in a pictureBox control. Which event should I use? And how can...
7
by: James | last post by:
Hi, I have a Windows Forms application which uses multiple child forms (MDI interface). The height of one of the child forms is larger than the height of the MDI client area, so when this...
3
by: Dave K | last post by:
I seem to be missing something... I want to use a mousewheel event in my VB.NET app... and there's a lot of example code on the net showing how to use the mousewheel event... and the .NET docs...
1
by: =?Utf-8?B?UmljaA==?= | last post by:
In a database search application (vb2005), the user wants to be able to scroll through records using the mousewheel. The data display form contains textboxes for the main data and a datagridview...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
1
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.