473,480 Members | 5,031 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

8 New Member
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 1937
Plater
7,872 Recognized Expert Expert
You can try overrideing the WndProc function on your form. And parse out the mouse wheel messages?
Jun 11 '08 #2
mike1reynolds
8 New Member
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 Recognized Expert Expert
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
mike1reynolds
8 New Member
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
1010
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
2982
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
1907
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
2201
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
2681
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
5831
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
3680
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
11496
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
3568
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
2451
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
7040
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6905
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
7041
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6736
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
5331
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,...
1
4772
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...
0
4478
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...
0
2994
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2980
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.