clipcursor(C# ClipCursor)

发布时间:2025-12-10 19:41:36 浏览次数:37

C# ClipCursor-

C# ClipCursor public Rectangle rect;    [DllImport(“user32.dll”,EntryPoint=”clipcursor”)]  private static extern bool clipcursor(Rectangle lpRect)    然后在你的绘制函数树中    Rectangle rect=

public Rectangle rect;

[DllImport(“user32.dll”,EntryPoint=”clipcursor”)]
private static extern bool clipcursor(Rectangle lpRect)

然后在你的绘制函数树中

Rectangle rect=new Rectangle(1,1,100,20);


接着你可以在你的mouse 事件中

加入clipcursor(rect)

这样你就可以只在这个区域响应事件了,但你必须,在事件完毕后

ClipCursor(clientRect)//放入整个 客户 区域

恢复到使mouse响应整个客户区域.

需要做网站?需要网络推广?欢迎咨询客户经理 13272073477