Вниз
Скачать: 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.015 c
6-81403
Prorva
2002-05-16 00:14
2002.07.25
И сново я, бестолковая:)


3-81128
Vicheslav
2002-07-03 13:10
2002.07.25
Помогите с Проектированием таблиц.


14-81410
Orest
2002-06-26 12:27
2002.07.25
Где достать Turbo pascal for windows?


14-81466
AlekseyK
2002-06-27 17:25
2002.07.25
Где можно взять прогу открывающую qrp файлы (файлы отчетов)


1-81254
SemFLY
2002-07-14 20:37
2002.07.25
DOS-Окно и информация в нём.




   Наверх