unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, Grids, DBGrids, DBTables;
type
TForm1 = class(TForm)
Table1: TTable;
DBGrid1: TDBGrid;
DataSource1: TDataSource;
private
{ Private declarations }
procedure MouseWheelHandler(var Message: TMessage);override;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.MouseWheelHandler(var Message: TMessage);
var
p:TPoint;
begin
GetCursorPos(p);
If WindowFromPoint(p)=DBGrid1.Handle then
begin
If Message.WParam<0 then
DBGrid1.Perform(WM_VSCROLL, SB_LINEDOWN, 0)
else
DBGrid1.Perform(WM_VSCROLL, SB_LINEUP, 0);
end;
end;
end.