我心依旧 通过本文主要向大家介绍了winform鼠标事件,winform 鼠标位置,winform添加购物车,winform界面设计,winform等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
本文实例讲述了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);</div>
解除限制鼠标的移动范围:
Screen[] screen = Screen.AllScreens; this.Cursor = new Cursor(Cursor.Current.Handle); Cursor.Clip = screen[0].Bounds;</div>
希望本文所述对大家的C#程序设计有所帮助。
</div>