Generating Random Numbers in Visual Basic 2010 is similar on how to Generate Random
Numbers in Visual Basic 6.0, first you must add 1 button and 3 labels on the form then create
a Sub Procedures named Randomize that shown in the code below:
'place this code on your button click event
Call Randomize
Sub Randomize() 'this is your random number generator
lbl1.Caption = CStr(Int(Rnd() * 10))
lbl2.Caption = CStr(Int(Rnd() * 10))
lbl3.Caption = CStr(Int(Rnd() * 10))
End Sub
The Hardest Thing to Do is to Do Nothing
Happy Coding (^_^)
Numbers in Visual Basic 6.0, first you must add 1 button and 3 labels on the form then create
a Sub Procedures named Randomize that shown in the code below:
'place this code on your button click event
Call Randomize
Sub Randomize() 'this is your random number generator
lbl1.Caption = CStr(Int(Rnd() * 10))
lbl2.Caption = CStr(Int(Rnd() * 10))
lbl3.Caption = CStr(Int(Rnd() * 10))
End Sub
The Hardest Thing to Do is to Do Nothing
Happy Coding (^_^)
Tags:
Visual Basic 2010
Leave a comment