Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 2005 > Pro Visual Basic 2005
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Pro Visual Basic 2005 For advanced Visual Basic coders working in version 2005. Beginning-level questions will be redirected to other forums, including Beginning VB 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro Visual Basic 2005 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 10th, 2008, 04:33 PM
Registered User
 
Join Date: Nov 2007
Location: Los Angeles, CA, USA.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Stop MouseWheel from autogenerating scroll 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?
  #2 (permalink)  
Old June 11th, 2008, 10:04 AM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Just shooting from the hip here, but have you tried the .Handled statement in the mousewheel event procedure to eliminate further bubbling up (through the scrollbar event handler, for instance) of the messages?
  #3 (permalink)  
Old June 11th, 2008, 01:35 PM
Registered User
 
Join Date: Nov 2007
Location: Los Angeles, CA, USA.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

There is no Handled member of the MouseEventArgs class. You had me really excited there for a moment!

  #4 (permalink)  
Old June 11th, 2008, 03:43 PM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Do you think it might be possible to add something useful to the MouseWheel()'s "Handles" list the additional events so that all comers come to the same routine? (I don't really have a candidate in mind.)

Perhaps you could then use a global boolean to block re-entrance into that procedure until the time of your choosing. Perhaps that will allow you to put the brakes on just a little, and that will be enough.

I didn't realize that .handled was kind of limited to key events... Sorry.
  #5 (permalink)  
Old June 12th, 2008, 01:50 PM
Registered User
 
Join Date: Nov 2007
Location: Los Angeles, CA, USA.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Looks like I have a couple of options, derive my own DataGridView and override the WndProc function, or check the sender in the grid's scroll handler and shunt the extra scroll messages manually.

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stop button won't stop loop JDShaffer Visual Basic 2008 Essentials 3 May 23rd, 2008 03:22 PM
mousewheel on crystalreportviewer SabinoFonseca VB.NET 2002/2003 Basics 1 October 10th, 2007 12:34 PM
How to Disable a Mousewheel Brendan Bartley Access 2 August 28th, 2005 07:36 PM
mousewheel causes subform to advance a record Loralee Access VBA 1 October 27th, 2004 11:14 PM
MQMgmtGetInfo trashes OS; Msgs queue up WBaran Pro VB 6 0 December 29th, 2003 06:03 PM



All times are GMT -4. The time now is 06:12 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.