Mark Anthony
Mark Anthony

Reputation: 127

How do you reset form properly in vb.net?

I got this game. It works well. form1 is the actual game and the form2 is the scorescreen and there is a play again button. Whenever I play again it plays but after the games end and goes to form2 which is the scorescreen it doesnt show any score at all and the game becomes unstable. Here is code:

Dim f2 As New Form2
            f2.Show()
            Me.Close()

Dim f1 As New Form1
            f1.Show()
            Me.Close()

Some images:

enter image description here

enter image description here

Upvotes: 1

Views: 559

Answers (1)

Nadeem_MK
Nadeem_MK

Reputation: 7689

That's a really unclear question. If you only want to move to first page on PLAY AGAIN button, just show the first form;

 Private Sub PlayAgain_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PlayAgain.Click
        Me.Hide()
        Form1.Show()    
    End Sub

Upvotes: 1

Related Questions