拖动控件

procedure TForm1.btn1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
const
    sc_DragMove   =   $f012;
begin
    ReleaseCapture;
    TM2Button(Sender).Perform(WM_SysCommand,   sc_DragMove,   0);
end;

原文地址:https://www.cnblogs.com/wjhx/p/1970701.html