Delphi Dbgrid滚轮问题解决

简介:
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 .
复制代码



本文转自黄聪博客园博客,原文链接:http://www.cnblogs.com/huangcong/archive/2010/08/22/1805718.html,如需转载请自行联系原作者
相关文章
|
9月前
|
Windows
实现vb滚轮滑动
实现vb滚轮滑动
53 0
|
9月前
|
Windows
分享:如何在VB中添加鼠标滚轮
分享:如何在VB中添加鼠标滚轮
|
C#
C#(Wpf)实现小键盘
原文:C#(Wpf)实现小键盘 花了一天时间小键盘基本功能已完成,先看看效果图吧!              默认:             Shift:     Caps Lock:   Button style ...
1213 0
|
C#
WPF 悬浮键盘
原文:WPF 悬浮键盘 public class TouchScreenKeyboard : Window { #region Property & Variable & Cons...
762 0
|
C#
WPF中设置快捷键
原文:WPF中设置快捷键 方式1: 窗体中加入资源                                                                                                        其中:CommandBindin...
905 0