1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
| unit Plan;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Grids, StdCtrls,extctrls, AppEvent, RxGrdCpt;
type
Planning=class(TStringGrid)
protected
end;
TForm1 = class(TForm)
Planning: TStringGrid;
procedure WMVSCROLL(var Message :TMessage); message WM_VSCROLL;
procedure FormCreate(Sender: TObject);
procedure PlanningTopLeftChanged(Sender: TObject);
procedure AfficheRec(Grid:TstringGrid);
private
{ Déclarations privées }
public
{ Déclarations publiques }
end;
var
Form1: TForm1;
OldWindowProcPlanning: TWndMethod;
implementation
procedure TForm1.FormCreate(Sender: TObject);
var x:integer;
begin
OldWindowProcPlanning := Planning.WindowProc; // Affecte une nouvelle procédure de fenêtre.
Planning.WindowProc := WMVSCROLL; //
....
end;
procedure TForm1.WMVSCROLL(Var message:Tmessage);
begin
if (message.msg=SB_LINEUP) then
showMessage('up');
if (message.msg=SB_LINEDOWN) then
showMessage('Down');
OldWindowProcPlanning(message);
end; |
Partager