|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
可怜的程序员,还是逃不出移植的命运!测试筹办,在空缺窗体上增加Memo1和Button1,然后激活Form1的以下事务(巅枫同砚体贴的):
OnMouseEnter、OnMouseLeave、OnMouseWheel、OnMouseWheelDown、OnMouseWheelUp,还用到其OnCreate事务.
然后依据以下测试代码,一试便知:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Memo1: TMemo;
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure FormMouseEnter(Sender: TObject);
procedure FormMouseLeave(Sender: TObject);
procedure FormMouseWheel(Sender: TObject; Shift: TShiftState;
WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
procedure FormMouseWheelDown(Sender: TObject; Shift: TShiftState;
MousePos: TPoint; var Handled: Boolean);
procedure FormMouseWheelUp(Sender: TObject; Shift: TShiftState;
MousePos: TPoint; var Handled: Boolean);
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
Memo1.ScrollBars := ssBoth;
Self.AutoScroll := True;
end;
procedure TForm1.FormMouseEnter(Sender: TObject);
begin
Memo1.Lines.Add(Form1_OnMouseEnter);
end;
procedure TForm1.FormMouseLeave(Sender: TObject);
begin
Memo1.Lines.Add(Form1_OnMouseLeave);
end;
procedure TForm1.FormMouseWheel(Sender: TObject; Shift: TShiftState;
WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
begin
Memo1.Lines.Add(Form1_OnMouseWheel);
end;
procedure TForm1.FormMouseWheelDown(Sender: TObject; Shift: TShiftState;
MousePos: TPoint; var Handled: Boolean);
begin
Memo1.Lines.Add(Form1_OnMouseWheelDown);
Button1.Top := Button1.Top - 4;
end;
procedure TForm1.FormMouseWheelUp(Sender: TObject; Shift: TShiftState;
MousePos: TPoint; var Handled: Boolean);
begin
Memo1.Lines.Add(Form1_OnMouseWheelUp);
Button1.Top := Button1.Top + 4;
end;
end.
刚刚打开这篇专题,猛然见到HAL9000发表的《对于大型公司项目平台选择j2ee的几层认识》系列,深受启发。 |
|