看到一个好方法,调用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);