Hi,

How do I stop the datagrid's vscrollbar from capturing mousewheel messages?
Seems they don't reach the grid's wndproc -where are they handled ? I need
to use the wheel to increment values in grid cells.

Thanks for your help

Jon

Re: Datagrid Scrollbar Capture by jon

jon
Sun Jan 23 09:17:54 CST 2005

Well I figured out how to do this. It's necessary to hook the mouse using
the SetWindowsHookEx function. The details are explained in Stephen
Teilhets' excellent book, SubClassing and Hooking with Visual Basic (ch13,
pp 363-4). This method hooks the mouse at low level and by listening for
mouse wheel messages and not passing them on (just return any positive
value), the grid scrollbar doesn't get a look in. Remember to unhook the
mouse when you're finished with it though as otherwise you'll bring back
fond memories of the blue screen of death...

Jon
"jon morgan" <jonrmorgan@ntlworld.com> wrote in message
news:Ofx%23wLTAFHA.3596@TK2MSFTNGP12.phx.gbl...
> Hi,
>
> How do I stop the datagrid's vscrollbar from capturing mousewheel
> messages?
> Seems they don't reach the grid's wndproc -where are they handled ? I need
> to use the wheel to increment values in grid cells.
>
> Thanks for your help
>
> Jon
>
>



Re: Datagrid Scrollbar Capture by Andrew

Andrew
Sun Jan 23 21:08:49 CST 2005

The mouse messages don't get to the datagrid because they get to the
scrollbar control(s) it contains; you could iterate the datagrid's Controls
collection and get to them. BTW, instead of using a windows hook, you might
be able to use Application.AddMessageFilter.

"jon morgan" <jonrmorgan@ntlworld.com> wrote in message
news:eXX256VAFHA.2640@TK2MSFTNGP14.phx.gbl...
> Well I figured out how to do this. It's necessary to hook the mouse using
> the SetWindowsHookEx function. The details are explained in Stephen
> Teilhets' excellent book, SubClassing and Hooking with Visual Basic
> (ch13, pp 363-4). This method hooks the mouse at low level and by
> listening for mouse wheel messages and not passing them on (just return
> any positive value), the grid scrollbar doesn't get a look in. Remember to
> unhook the mouse when you're finished with it though as otherwise you'll
> bring back fond memories of the blue screen of death...
>
> Jon
> "jon morgan" <jonrmorgan@ntlworld.com> wrote in message
> news:Ofx%23wLTAFHA.3596@TK2MSFTNGP12.phx.gbl...
>> Hi,
>>
>> How do I stop the datagrid's vscrollbar from capturing mousewheel
>> messages?
>> Seems they don't reach the grid's wndproc -where are they handled ? I
>> need
>> to use the wheel to increment values in grid cells.
>>
>> Thanks for your help
>>
>> Jon
>>
>>
>
>



Re: Datagrid Scrollbar Capture by jon

jon
Tue Jan 25 12:00:05 CST 2005

Thanks Andrew I'll check out the AddMessageFilter option - the hook is a
rather blunt if satisfying weapon.


"Andrew Smith (Infragistics)" <productmanager@infragistics.com> wrote in
message news:%236KWJIcAFHA.3292@TK2MSFTNGP10.phx.gbl...
> The mouse messages don't get to the datagrid because they get to the
> scrollbar control(s) it contains; you could iterate the datagrid's
> Controls collection and get to them. BTW, instead of using a windows hook,
> you might be able to use Application.AddMessageFilter.
>
> "jon morgan" <jonrmorgan@ntlworld.com> wrote in message
> news:eXX256VAFHA.2640@TK2MSFTNGP14.phx.gbl...
>> Well I figured out how to do this. It's necessary to hook the mouse using
>> the SetWindowsHookEx function. The details are explained in Stephen
>> Teilhets' excellent book, SubClassing and Hooking with Visual Basic
>> (ch13, pp 363-4). This method hooks the mouse at low level and by
>> listening for mouse wheel messages and not passing them on (just return
>> any positive value), the grid scrollbar doesn't get a look in. Remember
>> to unhook the mouse when you're finished with it though as otherwise
>> you'll bring back fond memories of the blue screen of death...
>>
>> Jon
>> "jon morgan" <jonrmorgan@ntlworld.com> wrote in message
>> news:Ofx%23wLTAFHA.3596@TK2MSFTNGP12.phx.gbl...
>>> Hi,
>>>
>>> How do I stop the datagrid's vscrollbar from capturing mousewheel
>>> messages?
>>> Seems they don't reach the grid's wndproc -where are they handled ? I
>>> need
>>> to use the wheel to increment values in grid cells.
>>>
>>> Thanks for your help
>>>
>>> Jon
>>>
>>>
>>
>>
>
>