این هم کد یونیت مورد نظر :
کد:
کد:
unit Unit1;
interfaceuses
* Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,* Dialogs, StdCtrls;
type*
TForm1 = class(TForm)**
* procedure FormMouseDown(Sender: TObject; Button: TMouseButton;***** Shift: TShiftState; X, Y: Integer);*
** 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);*
** procedure FormMouseUp(Sender: TObject; Button: TMouseButton;***
** Shift: TShiftState; X, Y: Integer);*
* procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X,***** Y: Integer);*
** procedure FormCreate(Sender: TObject);*
private*
** { Private declarations }*
public***
{ Public declarations }*
end;
var
* Form1: TForm1;
implementation
uses
Math;{$R *.dfm}
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
* Shift: TShiftState; X, Y: Integer);
begin
ShowMessage("X="+IntToStr(X) + "...Y="+IntToStr(Y));
if (X=100) and (Y=100) then
ShowMessage("Goal");
end;
procedure TForm1.FormMouseWheel(Sender: TObject; Shift: TShiftState;
* WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
begin
* ShowMessage("FormMouseWheel");
end;
procedure TForm1.FormMouseWheelDown(Sender: TObject; Shift: TShiftState;
* MousePos: TPoint; var Handled: Boolean);
begin*
ShowMessage("FormMouseWheelDown");
end;
procedure TForm1.FormMouseWheelUp(Sender: TObject; Shift: TShiftState;
* MousePos: TPoint; var Handled: Boolean);
begin
*ShowMessage("FormMouseWheelUp");
end;
procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton;*
Shift: TShiftState; X, Y: Integer);
begin
ShowMessage("FormMouseUp");
end;
procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState;
X,* Y: Integer);
begin
*if (X=100) and (Y=100) then
ShowMessage("FormMouseMove");
end;
end.
البته شما می تونید هر کاری رو که مد نظرتون هست در این مابین begin* و* end ها انجام بدید ...
علاقه مندي ها (Bookmarks)