Producing ships on battleship game using picturebox
<p>I am trying to be develop Battleship game and I am using picturebox to create a grid of 10x10. I managed to make this grid but I am stuck with making ships. 
 I have no idea how to make ships (as you can see in my code, the ships will be shown as woodenimage). Like one ship will take 4 picturebox in row and the other will take 3 picturebox in row. I am thinking to generate a random number to make a starting point for the ship and based on that point, I need to put the ship on the grid. </p>

<p>My code goes as follows:</p>

<pre><code>Public Class GameScvb
    Dim oceanimage As Image = My.Resources.oceanimage
    Dim missimage As Image = My.Resources.missimage
    Dim hitimage As Image = My.Resources.hitimage
    Dim shipimage As Image = My.Resources.woodenimage

    Private Function Box(ByVal X As Integer, ByVal Y As Integer, ByRef IsEnemy As Boolean) As PictureBox
        If IsEnemy Then
            Select Case X
                Case 0
                    Return Choose(Y + 1, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10)
                Case 1
                    Return Choose(Y + 1, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10)
                Case 2
                    Return Choose(Y + 1, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10)
                Case 3
                    Return Choose(Y + 1, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10)
                Case 4
                    Return Choose(Y + 1, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10)
                Case 5
                    Return Choose(Y + 1, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10)
                Case 6
                    Return Choose(Y + 1, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10)
                Case 7
                    Return Choose(Y + 1, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10)
                Case 8
                    Return Choose(Y + 1, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10)
                Case 9
                    Return Choose(Y + 1, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10)
            End Select
        Else
            Select Case X
                Case 0
                    Return Choose(Y + 1, SA1, SA2, SA3, SA4, SA5, SA6, SA7, SA8, SA9, SA10)
                Case 1
                    Return Choose(Y + 1, SB1, SB2, SB3, SB4, SB5, SB6, SB7, SB8, SB9, SB10)
                Case 2
                    Return Choose(Y + 1, SC1, SC2, SC3, SC4, SC5, SC6, SC7, SC8, SC9, SC10)
                Case 3
                    Return Choose(Y + 1, SD1, SD2, SD3, SD4, SD5, SD6, SD7, SD8, SD9, SD10)
                Case 4
                    Return Choose(Y + 1, SE1, SE2, SE3, SE4, SE5, SE6, SE7, SE8, SE9, SE10)
                Case 5
                    Return Choose(Y + 1, SF1, SF2, SF3, SF4, SF5, SF6, SF7, SF8, SF9, SF10)
                Case 6
                    Return Choose(Y + 1, SG1, SG2, SG3, SG4, SG5, SG6, SG7, SG8, SG9, SG10)
                Case 7
                    Return Choose(Y + 1, SH1, SH2, SH3, SH4, SH5, SH6, SH7, SH8, SH9, SH10)
                Case 8
                    Return Choose(Y + 1, SI1, SI2, SI3, SI4, SI5, SI6, SI7, SI8, SI9, SI10)
                Case 9
                    Return Choose(Y + 1, SJ1, SJ2, SJ3, SJ4, SJ5, SJ6, SJ7, SJ8, SJ9, SJ10)
            End Select
        End If
        Return Nothing
    End Function

    Private Sub InitialLayout()
        ' draw game board
        For i = 0 To 9
            For j = 0 To 9
                Box(i, j, True).BackgroundImage = oceanimage 'true indicates enemy grid / i - row / j coloumn
                Box(i, j, False).BackgroundImage = oceanimage 'false indicates my grid
            Next
        Next
        Me.Refresh()
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        InitialLayout()
        ships()
    End Sub

    Public Sub ships()
        Dim rnd As New Random
        Dim value4 As Integer
        Dim value41 As Integer

        value4 = rnd.Next(0, 7)
        value41 = value4 + 3

        'create ship with 4 space
        For i = value4 To value41
            Box(value4, value41, False).BackgroundImage = shipimage
        Next
    End Sub
End Class
</code></pre>

<p>After generating a random number, Box(value4, value41, false).backgoundimage = shipimage only shows one woodenimage in the picturebox rather than taking 4 picturebox.</p>