|
Visual Basic 2008 - Help with Flow of program
hello, below is a snippet of a program i am writing, a memory game. You click on a box to see a picture then you click on a 2nd box and see if the picture matches. The problem I am having is that on the 2nd click, the box is not displaying the picture until after all the IF THEN statements have been run. I'm pretty inexperienced so any help would be appreciated. Thanks
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
PictureBox1.Image = Image.FromFile("c:\match game\cover\" & oneone & ".bmp")
counter = counter + 1
If counter Mod 2 <> 0 Then
temp1 = oneone
firstclick = "oneone"
End If
If counter Mod 2 = 0 Then
PictureBox1.Image = Image.FromFile("c:\match game\cover\" & oneone & ".bmp")
temp2 = oneone
If temp1 = temp2 Then
timekiller()
turnover1(temp1, temp2, oneone, onetwo, onethree, onefour, onefive, onesix)
turnover2(temp1, temp2, twoone, twotwo, twothree, twofour, twofive, twosix)
turnover3(temp1, temp2, threeone, threetwo, threethree, threefour, threefive, threesix)
turnover4(temp1, temp2, fourone, fourtwo, fourthree, fourfour, fourfive, foursix)
turnover5(temp1, temp2, fiveone, fivetwo, fivethree, fivefour, fivefive, fivesix)
End If
If temp1 <> temp2 Then
secondclick = "oneone"
timekiller()
backover(firstclick, secondclick)
End If
End If
End Sub
|