Guess Number Project (guessnumber.ppt is the presentation)
Public Class
frmGuess
Inherits
System.Windows.Forms.Form
Dim ranNum
As Integer
Private Sub btnPlay_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
btnPlay.Click
trbGuess.Value = 1
'txtGuess.Text = 1
'lblMsg.Text = ""
Randomize()
ranNum = 1 + Int(Rnd() * 25)
btnPlay.Visible = False
End Sub
Private Sub trbGuess_Scroll(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
trbGuess.Scroll
txtGuess.Text = trbGuess.Value
End Sub
Private Sub btnChk_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
btnChk.Click
If txtGuess.Text = ranNum Then
lblMsg.Text =
"You Guessed It!!!!!!"
btnPlay.Visible = True
Else
If txtGuess.Text >
ranNum Then
lblMsg.Text = "Your Guess is Too High"
Else
lblMsg.Text = "Your Guess is Too Low"
End If
End If
End Sub
End Class