好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

winform实现限制及解除鼠标移动范围的方法

本文实例讲述了winform实现限制及解除鼠标移动范围的方法。分享给大家供大家参考。具体如下:

限制鼠标的移动范围:

// this.Cursor = new Cursor(this.Cursor.Handle);

// Cursor.Position = new Point(Cursor.Position.X, Cursor.Position.Y);

Cursor.Clip = new Rectangle( this .Location, this .Size);

解除限制鼠标的移动范围:

Screen[] screen = Screen.AllScreens;

this .Cursor = new Cursor(Cursor.Current.Handle);

Cursor.Clip = screen[0].Bounds;

希望本文所述对大家的C#程序设计有所帮助。

dy("nrwz");

查看更多关于winform实现限制及解除鼠标移动范围的方法的详细内容...

  阅读:95次