Examples Delphi

Asagidaki kod örneginde, farenin sol tusuna basiliyken, imlec form üzerinden baska bir yere tasinamamaktadir.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
TForm1 = class(TForm)
procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure FormMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
r:trect;
begin
canvas.pen.mode:=pmxor;
canvas.Pen.style:=psdot;
r:=boundsrect;
inflaterect(r,-30,-30);
clipcursor(@r);
end;
procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
clipcursor(nil);
end;
end.