1. Computing & Technology

Discuss in my forum

Zarko Gajic

Redirect Mouse Wheel Message To A Control Under The Mouse in Delphi Applications

By , About.com GuideNovember 28, 2011

Follow me on:

in Delphi Tips ::Mouse wheel is used for scrolling. When a scrollable control (TMemo, TListView, TTreeView, ...) has the input focus, moving the wheel will result in vertical scrolling of the content of the focused control. Many Windows applications (Delphi IDE including) have changed the default mouse wheel behaviour for input controls: when the wheel is spun, the control beneath the mouse is scrolled - never mind which control actually has the focus.

Read the full article to learn how to Redirect Mouse Wheel Message To A Control Under The Mouse in Delphi Applications

Related:

Comments
February 24, 2010 at 2:48 am
(1) Ron says:

Interesting, thank you.
This is what i have been looking for, i will use it with trichview!

my favorite delphi components http://www.components4developers.com

May 17, 2010 at 7:26 am
(2) Alex Egorov says:

I have 2 TVirtualStringTree components and this code does not work with this components

December 3, 2011 at 2:41 pm
(3) Craig says:

Works really well but I had to add the line below for my own purposes. Good for master/detail trees/grids

if wc.Handle Msg.hwnd then
begin
wc.SetFocus; //craig added this line to enable some grids
SendMessage(wc.Handle, WM_MOUSEWHEEL, Msg.wParam, Msg.lParam);
Handled := True;
end;

January 7, 2012 at 7:47 am
(4) Eitan says:

this is just what i need for a small game i make.
Thank you Zarko :)

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

©2012 About.com. All rights reserved.

A part of The New York Times Company.