给你一个实用的例子吧,
1.定义API:
function ulong SetCapture(ulong hwnd) library "user32.dll"
2.在MOUSEMOVE事件中:
SetCapture(handle(this))
IF ((XPos<0 or YPos<0) or (XPos>=this.Width or YPos>this.Height)) THEN
//MOUSE离开了
ReleaseCapture()
...
else
//MOUSE在TEXT上面
...
end if