Page 1 of 1

Basic Number Guessing Game In VB

Posted: Sat May 19, 2007 12:51 pm
by ag3nt
'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

Posted: Wed May 30, 2007 1:55 pm
by anish
Nice its a cool code in vb script for a simple game.
It have been some months that i am studying about VB. Its a cool programme.