I need code for Visual Basic 2010 Express.
I am doing a project in school that is about making a pupil (picturebox2) follow the mouse so that students can follow where the mouse is during a lesson. It is supposed to be "stuck" inside of something that can hold it in a rectangular "prison" but still follow the mouses movement inside of it. The "prison" is placed at the bottom left corner, and about 200x200 in size.
I could use code for getting pb2 not going outside of the prison and how I can make pb2 to follow the mouse anyway.
Sample code:
PictureBox2.Text = e.X.ToString
PictureBox2.Text = e.Y.ToString
Me.PictureBox2.Location = New System.Drawing.Point(e.X, e.Y)