Help with reseting form

moonieass13

New member
Joined
May 13, 2008
Messages
2
Programming Experience
Beginner
For class we had to make an application that is a game

the user inputs a number less than 3 and greater then 1 and it will take away the stones from the pile

I have to create a "New Game" button, how do I get the program to clear everything and reset the form as if I had just opened it...

so reset the form without closing it
 
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Randomize()

Static intStones As Integer = Int((intMax - intMin + 1) * Rnd()) + intMin
Dim intUser As Integer
Dim intComputer As Integer
Me.lblStones.Text = intStones

Thats the code in the form load
 
if i understood that correctly,
the whole game is based on data?

If that so, then to reset everything you should recall (assuming i understood the idea of the program correctly) the Form Load Sub routine:

ex:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Form1_Load(sender, e)
End Sub


Hope that helps,


Best Regards
Firas S Assaad
 
Back
Top