Вниз
Скачать: CL | DM;

Как можно осуществить перемещение по DBGrid с помощью колеса мыши   Найти похожие ветки 

 
AlexeyBl   (2002-07-11 19:24) [0]

Как можно осуществить перемещение по DBGrid с помощью колеса мыши?


 
Eugene Lachinov ©   (2002-07-11 19:55) [1]

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, Grids, DBGrids, DBTables;

type
TForm1 = class(TForm)
Table1: TTable;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
procedure MyMouseWheel(Sender: TObject; Shift: TShiftState;
WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

type
TDBGridWrapper = class(TDBGrid);

procedure TForm1.FormCreate(Sender: TObject);
begin
TDBGridWrapper(DBGrid1).OnMouseWheel := MyMouseWheel
end;

procedure TForm1.MyMouseWheel(Sender: TObject; Shift: TShiftState;
WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
const
k = 1;
begin
DBGrid1.DataSource.DataSet.MoveBy((-WheelDelta div WHEEL_DELTA) * k);
Handled := True;
end;


 
Eugene Lachinov ©   (2002-07-11 19:56) [2]

Только вот не знаю, возможно ли это в Delphi 5, код для Delphi 6



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.011 c
14-81434
Чайник2
2002-06-27 08:36
2002.07.25
Железо


1-81255
nitro313
2002-07-15 05:51
2002.07.25
Мастаки подскажите пожалуйста! Пишу я следующее...


1-81275
Glonia Zbanov
2002-07-15 13:06
2002.07.25
Можно ли сделать форму прозрачной


1-81326
Skier
2002-07-12 17:30
2002.07.25
Просто стало интересно


1-81287
vixic
2002-07-12 07:47
2002.07.25
MainMenu




   Наверх