标签:分享图片 oca ima width str bounds vat div 图片
实现效果:

知识运用:
Cursor类中的相关属性

实现代码:
private void button1_Click(object sender, EventArgs e)
{
this.Cursor = new Cursor(Cursor.Current.Handle); //创建Cursor对象
Cursor.Position = new Point(Cursor.Position.X,Cursor.Position.Y); //设置鼠标位置
Cursor.Clip = new Rectangle(this.Location,this.Size); //设置活动区域
}
private void button2_Click(object sender, EventArgs e)
{
this.Cursor = new Cursor(Cursor.Current.Handle);
Screen[] screen = Screen.AllScreens; //获取显示的数组
Cursor.Clip= screen[0].Bounds; //解除活动区域的限制
}
标签:分享图片 oca ima width str bounds vat div 图片
原文地址:https://www.cnblogs.com/feiyucha/p/10284669.html