blob: bbf513ae77b7e3185f91159c4c12917d237017ce (
plain)
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
|
unit DraggedFigureUnit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls;
type
TDraggedFigure = class(TForm)
Image1: TImage;
procedure FormCreate(Sender: TObject);
procedure Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
private
{ Private declarations }
public
{ Public declarations }
end;
var
DraggedFigure: TDraggedFigure;
implementation
{$R *.dfm}
procedure TDraggedFigure.FormCreate(Sender: TObject);
begin
ClientWidth:= 40;
end;
procedure TDraggedFigure.Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
const SC_DRAGMOVE = $F012;
begin ReleaseCapture;
Perform(WM_SYSCOMMAND, SC_DRAGMOVE, 0 );
end;
end.
|