Как заставить корректно работать колесо мыши в TDBGrid?
01.01.2007
{....} public procedure AppMessage(var Msg: TMsg; var Handled: Boolean); {....} procedure TForm1.AppMessage(var Msg: TMsg; var Handled: Boolean); var i: SmallInt; begin {Mouse wheel behaves strangely with dgbgrids - this proc sorts this out} 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; // And in the project source: {....} Application.OnMessage := Form1.AppMessage; {....}
Взято с сайта https://www.swissdelphicenter.ch/en/tipsindex.php