The code that adds and deletes instances of the class from the array is as critical as the class coding. In fact, it seems to me that at least half of the magic happens in this part of the program.
~~~~~~~~~~~~~~~~~~~~~~~~~
Private Sub AddToPB()
Dim a As Integer
If PBEmpty = False Then
a = PB.Length - 1
Dim temp(a) As PictureBoxClass
PB.CopyTo(temp, 0)
a += 1
ReDim PB(a)
temp.CopyTo(PB, 0)
Else
a = 0
PBEmpty = False
End If
PB(a) = New PictureBoxClass
With PB(a)
.ID = a
.Height = 50
.Width = 50
.FaceUp = False
.BackColor = Color.Red
.Top = PB(a).Height * a / 2
.Left = PB(a).Width * a / 2
.Visible = True
.BringToFront()
AddHandler PB(a).PicBoxClick, _
AddressOf FlipPB
Me.Controls.Add(PB(a))
End With
End Sub
~~~~~~~~~~~~~~~~~~~~~~~~~

