Mouse activity area limit

     // restricted mouse activity area 
        Private  void the button1_Click ( Object SENDER, EventArgs E) 
        { 
            the this .cursor = new new Cursor (Cursor.Current.Handle); // Create a Cursor object 
            Cursor.Position = new new Point (Cursor.Position.X, Cursor .Position.Y); // set the mouse position 
            Cursor.Clip = new new the Rectangle ( the this .location, the this .Size); // set the mouse active area 
        }
         // remove the restriction on the mouse active area 
        Private  void the button2_Click ( Object SENDER, EventArgs e)
        {
            Screen [] Screens = Screen.AllScreens; // get the array shown in 
            the this .cursor = new new Cursor (Cursor.Current.Handle); // Create a Cursor object 
            Cursor.Clip = Screens [ 0 ] .Bounds; // releasing the mouse restricted active region 

        }

 

Guess you like

Origin www.cnblogs.com/topsyuan/p/11325268.html