by SeeD (22 Submissions)
Category: Miscellaneous
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Date Added: Wed 3rd February 2021
Rating: (15 Votes)
MAKE AN EASY LOTTO GAME!!! ***UPDATED***
Inputs
You're going to need 3 Labels to start. You can add more once you get the hang of it. You also need 1 Command button. Make it's caption "OK", and the Labels captions blank. Follow the simple instructions below.
Assumes
You can alter this code to your convienience. Here are some nifty things you could change:
You could use text boxes instead of labels. You would have to change every "Label1.Caption" to "Text1.Text" and so on.
You can add as many more text boxes or labels as you'd like, as long as you adjust the code accrodingly.
If your smart enough, you could make it a simple password entry screen, but you'd have to do some easy error handling and you'd have to use text boxes instead of labels.
If your smart enough, you could make a simple lotto game to share with your friends and family. - SeeD (o:
Private Sub Command1_Click()
Label1.Caption = Int(rnd * 10)
Label2.Caption = Int(rnd * 10)
Label3.Caption = Int(rnd * 10)
If (Label1.Caption = Label2.Caption) And (Label3.Caption = Label2.Caption) Then
MsgBox "You Win!", 8, "Winner!"
End If
End Sub