How to Generate Random Numbers in Vb6

this is the basic way on how to generate a Random Numbers in VB6, Just Add 3 Label
Control named it with lbl1,lbl2,lbl3 and 1 command button, and create a Sub Procedure
and call it vial click event of your command button and the code will look like this:

Private Sub Command1_Click()
Call Randomize
End Sub
Sub Randomize()
        lbl1.Caption = CStr(Int(Rnd() * 10))
        lbl2.Caption = CStr(Int(Rnd() * 10))
        lbl3.Caption = CStr(Int(Rnd() * 10))
End Sub

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

One Response to this post

  1. Anonymous on July 1, 2011 at 7:06 PM

    Thanks for this Code,.! It helps me a lot.

    Can you send me, How to generate Alpha-Numeric for example.
    abc81239
    sdj12324
    jgf34577
    Here's my email. uclmbenz_castro@yahoo.com

    Thanks for this.

Leave a comment

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