Just drop a TApplicationEvents ("Additional" tab on the Component Palette) component on a form and handle it's OnMessage event as:
~~~~~~~~~~~~~~~~~~~~~~~~~
procedure TForm1.ApplicationEvents1Message
(var Msg: TMsg; var Handled: Boolean) ;
var
i: SmallInt;
begin
if Msg.message = WM_MOUSEWHEEL then
begin
Msg.message := WM_KEYDOWN;
Msg.lParam := 0;
i := HiWord(Msg.wParam) ;
if i > 0 then
Msg.wParam := VK_UP
else
Msg.wParam := VK_DOWN;
Handled := False;
end;
end;
~~~~~~~~~~~~~~~~~~~~~~~~~
Note: This fixes the mouse wheel behavior not only for DBGrid-s but for all other list component (TListBox, TListView, etc).
Delphi tips navigator:
» Adding QuickReports to the Delphi 7 Component Palette
« Connect and disconnect to/from the Internet

