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);

posted @ 2013-02-19 11:50  点滴成事  阅读(491)  评论(0编辑  收藏  举报