There are a few things you need to do.
First, use the
Form.Controls
property gives you the list of controls on the form. You can then use the
GetType
method on the control to determine if the control is a picture box.
If it is, you get the location and the size and find the centre and possibly put it into a list holding a collection of
Point
objects.
You then have a list of locations for your mouse to go to periondically (which can be implemented by a timer). Once you have this, when your mouse goes to index 1, you set the border of the picture box to a red square.
Your done :)
I will write some quick code on the main concepts to get you started:
List<Point> picture_centers = new List<Point>();
foreach(Control c in this.Controls)
{
if(c.GetType() == typeof(PictureBox))
{
Point center = new Point();
picture_centers.Add(center);
}
}
foreach(Point p in picture_centers)
{
Cursor.Position = p;
Control c = this.GetChildAtPoint(p);
PictureBox pic = (PictureBox) c;
pic.BorderStyle = ;
}