- 註冊時間
 - 2006-3-13 
 - 最後登錄
 - 2025-7-23 
 - 在線時間
 - 675 小時 
 - 閱讀權限
 - 200 
 - 積分
 - 417 
 - 帖子
 - 1109 
 - 精華
 - 0 
 - UID
 - 2 
  
 
 
 
    
 | 
 
參考來源 http://www.cnblogs.com/huangcong/archive/2010/08/22/1805718.html- unit Unit1;
 
  
- interface
 
  
- uses
 
 - Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
 
 - Dialogs, DB, ADODB, Grids, DBGrids, StdCtrls;
 
  
- type
 
 - TDBGrid=class(DBGrids.TDBGrid)
 
 -     public
 
 -     function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint): Boolean; override;
 
 -     end;
 
  
- TForm1 = class(TForm)
 
 -     DataSource1: TDataSource;
 
 -     DBGrid1: TDBGrid;
 
 -     ADOTable1: TADOTable;
 
 -     Edit1: TEdit;
 
 - private
 
 -     { Private declarations }
 
 - public
 
 -     { Public declarations }
 
 - end;
 
  
- var
 
 - Form1: TForm1;
 
  
- implementation
 
  
- {$R *.dfm}
 
 - function TDBGrid.DoMouseWheel(Shift: TShiftState; WheelDelta: Integer;
 
 -     MousePos: TPoint): Boolean;
 
 - begin
 
 -     if WheelDelta < 0 then
 
 -     datasource.DataSet.Next;
 
 -     if wheelDelta > 0 then
 
 -     DataSource.DataSet.Prior;
 
 - end;
 
  
- end.
 
  複製代碼 |   
 
  
 |