Advertisement
Guest User

Untitled

a guest
May 27th, 2015
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.63 KB | None | 0 0
  1.     Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
  2.         Dim intrandom As New Random
  3.         Dim intGetal As Integer
  4.         Dim intGetal2 As Integer
  5. A:
  6.         intGetal = intrandom.Next(0, 10)
  7.         intGetal2 = intrandom.Next(0, 10)
  8.         Dim intSom As Integer = intGetal + intGetal2
  9.         If InputBox("Hoeveel is " & intGetal & " + " & intGetal2 & " ?") = intSom Then
  10.             MessageBox.Show("Correct!")
  11.             GoTo A
  12.         Else
  13.             MessageBox.Show("Niet correct! Probeer later opnieuw")
  14.             Me.Close()
  15.         End If
  16.     End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement