Delphi-Quellcode:
...
var
md : Boolean;
mp : TPoint;
...
procedure TMainForm.PanelHeaderBarMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
var
P : TPoint;
begin
if not md then Exit;
P := Point(PanelHeaderBar.Left+(X - mp.X),PanelHeaderBar.Top + (Y - mp.Y));
P := ClientToScreen(P);
P.Y := P.Y - (Height-(ClientRect.Bottom-ClientRect.Top))-PanelHeaderBar.Top;
Left := P.X;
Top := P.y;
end;
...
procedure TMainForm.PanelHeaderBarMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
md := True;
mp := Point(X,Y);
end;
...
procedure TMainForm.PanelHeaderBarMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
md := False;
end;
so hab ich das mal gemacht