rag(Sender, Target: TObject; X, Y: Integer);
private
{ Private declarations }
public
{ Public declarations }
x_panel,y_panel,x_label,y_label:integer;
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
close;
end;
procedure FTorm1.Panel1MouseMove(Sender: TObject; Shift: TShiftState;X,Y: Integer);
begin
x_panel:=X;
y_panel:=Y;
end;
procedure TForm1.Panel1DragOver(Sender, Source: TObject; X, Y: Integer;
State: TDragState; var Accept: Boolean);
begin
x_panel:=X;
y_panel:=Y;
end;
procedure TForm1.Label1MouseMove(Sender: TObject; Shift: TShiftState;X,Y: Integer);
begin
x_label:=X;
y_label:=Y;
end;
procedure TForm1.Label1EndDrag(Sender, Target: TObject; X, Y: Integer);
begin
label1.left :=x_panel-x_label;
label1.top:=y_panel-y_label;
end;
end.