How to Generate Random Numbers in Vb2010

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 (^_^)
These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • Reddit
  • Spurl
  • StumbleUpon
  • Technorati

Leave a comment

Copyright @ Codes-47.Blogspot.Com. Powered by Blogger.