You can use the forms OnMousewheel event:
procedure TForm1.FormMouseWheel(Sender: TObject; Shift: TShiftState;
WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
Var
msg: Cardinal;
code: Cardinal;
i, n: Integer;
begin
If WindowFromPoint( mouse.Cursorpos ) = dbgrid1.Handle Then Begin
Handled := true;
If ssShift In Shift Then
msg := WM_HSCROLL
Else
msg := WM_VSCROLL;
If WheelDelta < 0 Then
code := SB_LINEUP
Else
code := SB_LINEDOWN;
n:= Mouse.WheelScrollLines;
For i:= 1 to n Do
dbgrid1.Perform( msg, code, 0 );
dbgrid1.Perform( msg, SB_ENDSCROLL, 0 );
End;
end;
--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be