bestlong 怕失憶論壇

 

 

搜索
bestlong 怕失憶論壇 論壇 Delphi Delphi DbGrid 滾輪不正常問題解決
查看: 3064|回復: 0
go

Delphi DbGrid 滾輪不正常問題解決 [複製鏈接]

Rank: 9Rank: 9Rank: 9

1#
發表於 2010-10-29 15:08 |只看該作者 |倒序瀏覽 |打印
參考來源 http://www.cnblogs.com/huangcong/archive/2010/08/22/1805718.html
  1. unit Unit1;

  2. interface

  3. uses
  4. Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  5. Dialogs, DB, ADODB, Grids, DBGrids, StdCtrls;

  6. type
  7. TDBGrid=class(DBGrids.TDBGrid)
  8.     public
  9.     function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint): Boolean; override;
  10.     end;

  11. TForm1 = class(TForm)
  12.     DataSource1: TDataSource;
  13.     DBGrid1: TDBGrid;
  14.     ADOTable1: TADOTable;
  15.     Edit1: TEdit;
  16. private
  17.     { Private declarations }
  18. public
  19.     { Public declarations }
  20. end;

  21. var
  22. Form1: TForm1;

  23. implementation

  24. {$R *.dfm}
  25. function TDBGrid.DoMouseWheel(Shift: TShiftState; WheelDelta: Integer;
  26.     MousePos: TPoint): Boolean;
  27. begin
  28.     if WheelDelta < 0 then
  29.     datasource.DataSet.Next;
  30.     if wheelDelta > 0 then
  31.     DataSource.DataSet.Prior;
  32. end;

  33. end.
複製代碼
我是雪龍
http://blog.bestlong.idv.tw
http://www.bestlong.idv.tw
‹ 上一主題|下一主題

Archiver|怕失憶論壇

GMT+8, 2025-5-3 05:23 , Processed in 0.012147 second(s), 11 queries .

Powered by Discuz! X1.5

© 2001-2010 Comsenz Inc.