1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| unit DBMouseWheel;
interface
uses
Windows, Classes, DBGrids;
type
TDBGrid = class(DBGrids.TDBGrid)
protected
function DoMouseWheelDown(Shift: TShiftState; MousePos: TPoint): Boolean; override;
function DoMouseWheelUp(Shift: TShiftState; MousePos: TPoint): Boolean; override;
end;
implementation
{ TDBGrid }
function TDBGrid.DoMouseWheelDown(Shift: TShiftState;
MousePos: TPoint): Boolean;
begin
Result := DataLink.Active;
if Result then
DataLink.DataSet.MoveBy(1);
end;
function TDBGrid.DoMouseWheelUp(Shift: TShiftState;
MousePos: TPoint): Boolean;
begin
Result := DataLink.Active;
if Result then
DataLink.DataSet.MoveBy(-1);
end;
end. |
Partager