vb Code:
Public Class Form2
Dim objects() As PictureBox
Private Enum direction
N
NE
E
SE
S
SW
W
NW
End Enum
Dim currentDirection As direction = direction.N
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
objects = New PictureBox() {PictureBox1, PictureBox2, PictureBox3}
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Select Case currentDirection
Case direction.N
PictureBox4.Top -= 10
Case direction.NE
PictureBox4.Top -= 10
PictureBox4.Left += 10
Case direction.E
PictureBox4.Left += 10
Case direction.SE
PictureBox4.Top += 10
PictureBox4.Left += 10
Case direction.S
PictureBox4.Top += 10
Case direction.SW
PictureBox4.Top += 10
PictureBox4.Left -= 10
Case direction.W
PictureBox4.Left -= 10
Case direction.NW
PictureBox4.Top -= 10
PictureBox4.Left -= 10
End Select
Dim hit As PictureBox = objects.FirstOrDefault(Function(o) o.Bounds.IntersectsWith(PictureBox4.Bounds))
If hit IsNot Nothing Then
'PictureBox4 has collided with another picturebox
'change currentDirection
End If
End Sub
End Class