Visual Basic Battleship game complications

Tags:
Visual Basic
Visual Studio 2015
Hello! I am creating a battleship game on visual basic for my computer programming 2 final. In order to chose where you want to place the ship, I allow the user to click on a picturebox of the ship and it brings up another form that has the battleship grid with a checkbox on each square. I realize this may seem like a difficult way to do this, but on the ship placement form there is a done button, and when clicked, it checks all of the possibilities for the placement of a ship. If a certain checkbox is checked, the corresponding picturebox on the main form will become visible and display a a picture of a section of the ship, corresponding to what order the user checked the checkboxes. The problem is that, whenever I open up the ship placement form, check the boxes, and click the done button, the pictureboxes on the main form do not become visible and I don't know if the picture that I assigned in code will display. Here is a section of the code:
If chkA1.Checked = True Then
frmMain.picPatrolA1.Visible = True
frmMain.picPatrolA1.Image = My.Resources.Patrol_Boats
If chkA2.Checked = True Then
frmMain.picPatrolA2.Visible = True
frmMain.picPatrolA2.Image = My.Resources.Patrol_Boat3
Me.Hide()
ElseIf chkB1.Checked = True Then
frmMain.picPatrolB1.Visible = True
frmMain.picPatrolB1.Image = My.Resources.Patrol_Boat3
Me.Hide()
Else
MessageBox.Show("Cant place this ship like that!")
End If
Please help! Thanks!
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • ToddN2000
    Have you tried using debug to check your logic?  Debugging will be a part of your future. If you still cannot find the issue, come back with some more details on where the debug fails... Sound like a fun programming challenge... 
    132,840 pointsBadges:
    report
  • Subhendu Sen
    If you have a good debugging knowledge, then you can find out at least one clue to overcome this. First try to debug and try to understand the problems.
    139,010 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: