你可以试试以下代码,有心得别忘了和我分享:<br>var <br> rtButton2:TRect;//BooL Clipcursir(const RECT*cprect);<br>begin<br> rtButton2:=Button2.BoundsRect;//将坐标转换为屏幕坐标<br> MapwindowPoints(handle,0,rtButton2,2);//将范围限制在Button2上<br> clipcursor(@rtButton2);//取消限制==>>clipcursor(0);<br>end;