1

I want to scroll horizontal in my grid (inherited from DataGridView). Not with Ctrl+scrolling tiltwheel (mousewheel), but by pushing the mousewheel to the left or the right.

First I tried it by catching the WM_MOUSEHWHEEL (0x020E) message in WndProc, but this fires only once (and I want to keep on moving left or right as long as I push).

I used Spy++ to check the messages of my control, but found nothing usefull :$ I checked the same on a Richtextbox (and notepad) and it seems that there is another message that fires : WM_HSCROLL (0x0114).

The richtextbox doesn't scroll horizontally by pushing the wheel left or right, but I can catch the WM_HSCROLL in the WndProc function. I can't do that in the DataGridView (the Message doesn't arrive there).

So I am wondering if there is a way to get this thing working?

Regards,

TakeItEasy

TakeItEasy
  • 11
  • 2

1 Answers1

0

Have you tried it with a horizontal scroll bar as a sanity check ? Described here: Stack Overflow : Mouse Tilt Wheel

It could also be that the DataGridView needs keyboard focus and that is why the RichEdit control scrolls, but the the DataGridView does not.

Community
  • 1
  • 1
  • Hi Brian, First of all thanks for answering :) I forgot 1 thing: setting the m.Result to (IntPtr)1. When I do this the messages keeps firing. If I don't the message fires only once. Regards, TakeItEasy – TakeItEasy Nov 20 '09 at 08:54
  • The problem is solved at: http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/91589821-27e6-48fc-9330-3b93c5d7245a – TakeItEasy Feb 17 '10 at 14:06