I keep getting this when I go to debug:
"Error 1 Operator '=' is not defined for types 'Integer' and 'System.Random'. C:\Documents and Settings\All Users\Documents\College-C\IT\VB.Net\Assignments\16.11\GuessNumber.vb 16 10 GuessNumber"
I'm getting the same thing for the greater than and less than operators. I've been banging my head for an hour now trying to figure out what I'm doing wrong here. Any help would be fantastic.
Here is the code:
Public Class GuessNumberForm Dim randNum As Random = New Random Dim myGuess As Integer = Val(guessNumberTextBox.Text) Private Sub newGameButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles newGameButton.Click 'gen randNum Dim randNumGenerated As Integer = randNum.Next enterButton.Enabled = True newGameButton.Enabled = False outputLabel.Text = "" End Sub Private Sub enterButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles enterButton.Click 'compares user's guess to randNum If myGuess = randNum Then outputLabel.Text = "Correct!" enterButton.Enabled = False newGameButton.Enabled = True ElseIf myGuess < randNum Then outputLabel.Text = "Too low..." ElseIf myGuess > randNum Then outputLabel.Text = "Too high..." End If End Sub End Class ' GuessNumberForm