PDA

Click to See Complete Forum and Search --> : Please test this


ZueS
Jan 19th, 2010, 02:17 PM
Very first app, Let me know if it works good.

Public Class Form1
Dim r As New Random
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Label1.Text = "0"
Label1.Text = r.Next(1, 20).ToString
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text = Label1.Text Then
MsgBox("You guessed right!")
Else
MsgBox("You guessed wrong!, Please guess again")
Label1.Text = r.Next(1, 20).ToString
End If
End Sub
End Class

There is the source.

Thanks.