接触/限制鼠标活动区域

this.Cursor = new Cursor(Cursor.Current.Handle);
            Cursor.Position = new Point(Cursor.Position.X,Cursor.Position.Y);//鼠标位置
            Cursor.Clip = new Rectangle(this.Location,this.Size);//设置鼠标活动区域窗体的位置和大小

 Screen screen = Screen.PrimaryScreen; //创建Screen对象
            this.Cursor = new Cursor(Cursor.Current.Handle);//鼠标
            Cursor.Clip = new Rectangle(screen.Bounds.Location,screen.WorkingArea.Size);//设置鼠标活动区域
原文地址:https://www.cnblogs.com/wjshan0808/p/4234265.html