So I have 18 face down cards i want to shuffle to different locations. There are 3 rows of 6. I have it working except the fact that 5 cards keep going behind other cards, leaving 5 empty spaces! Very annoying and i can not figure out how to fix this for the life of me. Any help here would be greatly appreciated! Thanks!!

Buttons 14-18 are the ones that keep going behind other buttons.

This is my code:

Dim startLoc = {{94, 110}, {302, 110}, {517, 110}, {727, 110}, {936, 110}, {1149, 110},
{94, 372}, {302, 372}, {517, 372}, {727, 372}, {936, 372}, {1149, 372},
{94, 628}, {302, 628}, {517, 628}, {727, 628}, {936, 628}, {1149, 628}}
Dim tempArray(startLoc.Length) As Integer
tempArray = New Integer(startLoc.Length) {}
Dim randomValue As Integer
Dim counter = 0
randomValue = CInt(Math.Floor(((startLoc.GetLength(0) - 1) - 0 + 1) * Rnd()))
If tempArray.Length = 0 Then
tempArray(counter) = randomValue
counter = counter + 1
Else
For i = 0 To startLoc.Length
If Not (tempArray.Contains(randomValue)) Then
tempArray(counter) = randomValue
counter = counter + 1
End If
randomValue = CInt(Math.Floor(((startLoc.GetLength(0) - 1) - 0 + 1) * Rnd()))
Next
End If
Button1.Location = New System.Drawing.Point(startLoc.GetValue(tempArray(0), 0), startLoc.GetValue(tempArray(0), 1))
Button2.Location = New System.Drawing.Point(startLoc.GetValue(tempArray(1), 0), startLoc.GetValue(tempArray(1), 1))
Button3.Location = New System.Drawing.Point(startLoc.GetValue(tempArray(2), 0), startLoc.GetValue(tempArray(2), 1))
Button4.Location = New System.Drawing.Point(startLoc.GetValue(tempArray(3), 0), startLoc.GetValue(tempArray(3), 1))
Button5.Location = New System.Drawing.Point(startLoc.GetValue(tempArray(4), 0), startLoc.GetValue(tempArray(4), 1))
Button6.Location = New System.Drawing.Point(startLoc.GetValue(tempArray(5), 0), startLoc.GetValue(tempArray(5), 1))
Button7.Location = New System.Drawing.Point(startLoc.GetValue(tempArray(6), 0), startLoc.GetValue(tempArray(6), 1))
Button8.Location = New System.Drawing.Point(startLoc.GetValue(tempArray(7), 0), startLoc.GetValue(tempArray(7), 1))
Button9.Location = New System.Drawing.Point(startLoc.GetValue(tempArray(8), 0), startLoc.GetValue(tempArray(8), 1))
Button10.Location = New System.Drawing.Point(startLoc.GetValue(tempArray(9), 0), startLoc.GetValue(tempArray(9), 1))
Button11.Location = New System.Drawing.Point(startLoc.GetValue(tempArray(10), 0), startLoc.GetValue(tempArray(10), 1))
Button12.Location = New System.Drawing.Point(startLoc.GetValue(tempArray(11), 0), startLoc.GetValue(tempArray(11), 1))
Button13.Location = New System.Drawing.Point(startLoc.GetValue(tempArray(12), 0), startLoc.GetValue(tempArray(12), 1))
Button14.Location = New System.Drawing.Point(startLoc.GetValue(tempArray(13), 0), startLoc.GetValue(tempArray(13), 1))
Button15.Location = New System.Drawing.Point(startLoc.GetValue(tempArray(14), 0), startLoc.GetValue(tempArray(14), 1))
Button16.Location = New System.Drawing.Point(startLoc.GetValue(tempArray(15), 0), startLoc.GetValue(tempArray(15), 1))
Button17.Location = New System.Drawing.Point(startLoc.GetValue(tempArray(16), 0), startLoc.GetValue(tempArray(16), 1))
Button18.Location = New System.Drawing.Point(startLoc.GetValue(tempArray(17), 0), startLoc.GetValue(tempArray(17), 1))