unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls;
type
TForm1 =
class(TForm)
Panel1: TPanel;
Panel2: TPanel;
Panel3: TPanel;
Panel4: TPanel;
Panel5: TPanel;
procedure Panel1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure Panel1EndDrag(Sender, Target: TObject; X, Y: Integer);
procedure FormDragOver(Sender, Source: TObject; X, Y: Integer;
State: TDragState;
var Accept: Boolean);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Panel1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Button = mbLeft
then { Nur ziehen, wenn linke Maustaste gedrückt ist }
with Sender
as TPanel
do { Sender als TFileListBox behandeln }
sou BeginDrag(False);
{ Wenn ja, dann ziehen }
end;
procedure TForm1.Panel1EndDrag(Sender, Target: TObject; X, Y: Integer);
begin
if Target <>
nil then
begin
(sender
as TPanel).Top:=y;
(sender
as TPanel).Left:=x;
(sender
as TPanel).Update;
end;
end;
procedure TForm1.FormDragOver(Sender, Source: TObject; X, Y: Integer;
State: TDragState;
var Accept: Boolean);
begin
if Source
is TPanel
then
Accept := True
else
Accept := False;
end;
end.