Duvida Jogo da Memória..
Minha duvida é quando clico na imagem como fazer ela voltar para a imagem sorteada.
Duvida 2 como comparar as imagens e retornar um msgbox indicando que está certo e se estiver errado , informar que está errado e fechar a imagem?
desde já agradeço
Código
Private Sub btJogar_Click(sender As Object, e As EventArgs) Handles btJogar.Click
Randomize()
Timer1.Enabled = True
btJogar.Enabled = False
Dim i, par As Integer
'Para habilitar todas as pic com imagens
For i = 1 To 20
pic(i).Enabled = True
Next
''para fazer o sorteio das imagens
For i = 1 To 20
sorteio(i) = Int((20 * Rnd()) + 1)
Next
For i = 1 To 20
For vx = 1 To i - 1
While (sorteio(i) = sorteio(vx))
sorteio(i) = Int((20 * Rnd()) + 1)
vx = 1
End While
Next
Next
'atribui a imagem sorteada em todos pic
pic(sorteio(1)).Image = figuras(1)
pic(sorteio(2)).Image = figuras(1)
'If par = sorteio(1) = sorteio(2) Then
' MsgBox("Acertou")
'End If
pic(sorteio(3)).Image = figuras(2)
pic(sorteio(4)).Image = figuras(2)
pic(sorteio(5)).Image = figuras(3)
pic(sorteio(6)).Image = figuras(3)
pic(sorteio(7)).Image = figuras(4)
pic(sorteio(8)).Image = figuras(4)
pic(sorteio(9)).Image = figuras(5)
pic(sorteio(10)).Image = figuras(5)
pic(sorteio(11)).Image = figuras(6)
pic(sorteio(12)).Image = figuras(6)
pic(sorteio(13)).Image = figuras(7)
pic(sorteio(14)).Image = figuras(7)
pic(sorteio(15)).Image = figuras(8)
pic(sorteio(16)).Image = figuras(8)
pic(sorteio(17)).Image = figuras(9)
pic(sorteio(18)).Image = figuras(9)
pic(sorteio(19)).Image = figuras(10)
pic(sorteio(20)).Image = figuras(10)
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
lblSegundos.Text += 1
If lblSegundos.Text = "60" Then
lblMinutos.Text += 1
End If
If lblSegundos.Text = "3" Then
For i = 1 To 20
pic(i).Image = My.Resources.interrogacao
Next
End If
End Sub