'Rolls 3 times and disables button
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btndiceRoll.Click
countRolls = countRolls + 1
Timer1.Enabled = True
If countRolls = 3 Then
btndiceRoll.Enabled = False
End If
End Sub
'Dice change 10 times and holding dice
If Hold1.Checked = False Then
r1 = Int(Rnd() * 6) + 1
End If
' rnd picks a number between 0 and .999999
If r1 = 1 Then
Dice1.Load("c:\Programming2010\Dice\d1.gif")
End If
If r1 = 2 Then
Dice1.Load("c:\Programming2010\Dice\d2.gif")
End If
If r1 = 3 Then
Dice1.Load("c:\Programming2010\Dice\d3.gif")
End If
If r1 = 4 Then
Dice1.Load("c:\Programming2010\Dice\d4.gif")
End If
If r1 = 5 Then
Dice1.Load("c:\Programming2010\Dice\d5.gif")
End If
If r1 = 6 Then
Dice1.Load("c:\Programming2010\Dice\d6.gif")
End If
'rolls Dice 10 times before stopping
If countTimes = 10 Then
Timer1.Enabled = False
countTimes = 0
End If
No comments:
Post a Comment