delphi 拖动具有onmousemove onmousedown onmouseup事件的空间

看到一个好方法,调用api,再不用在 move down up事件下来回计算了具体方法如下

控件的 onmousemove事件内写如下代码

ReleaseCapture;//Prevents the control from currently capturing all the mouse messages.阻止控件捕获当前的所有鼠标消息
//Capture empties the root's Captured property.
SendMessage(Self.Handle,WM_SYSCOMMAND,SC_MOVE+1,0);

原文地址:https://www.cnblogs.com/theonewu/p/2916838.html