Basic Number Guessing Game In VB
Posted: Sat May 19, 2007 12:51 pm
'add 1 commandubtton named command1 and 1 textbox named text1
Private Sub Command1_****()
Dim x As Integer ' declare x variable as integer
x = Int(Rnd * 9) + 1 ' randomize numbers 0 to 9
If Text1.Text = x Then ' if user is true then
MsgBox "congrulations!you won,answer was " & x
Else
MsgBox "sorry wrong"
End If
End Sub
basic game to understand basics of vb
Private Sub Command1_****()
Dim x As Integer ' declare x variable as integer
x = Int(Rnd * 9) + 1 ' randomize numbers 0 to 9
If Text1.Text = x Then ' if user is true then
MsgBox "congrulations!you won,answer was " & x
Else
MsgBox "sorry wrong"
End If
End Sub
basic game to understand basics of vb