Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataGridView MouseWheel: How-to prevent three scroll msgs per detent

Status
Not open for further replies.

ProtocolPirate

Programmer
Nov 21, 2007
104
US
Scrolling my VirtualMode DGV is very sluggish and it gets so far behind that it will continue scrolling long after you stop turning the mouse wheel. All other scrolling is fine, only mouse wheel scrolling is poorly behaved.

I think the problem is that turning the mouse wheel one detent (one click) triggers three *separate* scroll messages. I would like to be able to capture the scroll wheel message, prevent it from automatically turning into scroll messages, and control the scrolling myself directly in the mousewheel event, doing all three scrolls together as a single three row scroll.

Alternately, I could use PeekMessage, but I can't seem to get scrollbar messages for the DGV.Handle, and I can't access a handle for the vertical scrollbar at all.

So how do I prevent the mousewheel message from automatically generating three scroll messages? Or alternately, how can I get messages sent to the DGV's vertical scrollbar?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top